MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / flash_write

Function flash_write

core/mem.c:171–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171static void flash_write(uint32_t addr, uint8_t byte) {
172 unsigned int selected;
173 bool valid = false;
174
175 if (addr < 0x10000) {
176 selected = addr / SIZE_FLASH_SECTOR_8K;
177 valid = (mem.flash.sector8k[selected].ipb & mem.flash.sector8k[selected].dpb) == 1;
178 } else {
179 selected = addr / SIZE_FLASH_SECTOR_64K;
180 valid = (mem.flash.sector[selected].ipb & mem.flash.sector[selected].dpb) == 1;
181 }
182
183 if (valid == true) {
184 mem.flash.block[addr] &= byte;
185 }
186}
187
188static void flash_erase(uint32_t addr, uint8_t byte) {
189 unsigned int i;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected