| 169 | } |
| 170 | |
| 171 | static 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 | |
| 188 | static void flash_erase(uint32_t addr, uint8_t byte) { |
| 189 | unsigned int i; |
nothing calls this directly
no outgoing calls
no test coverage detected