This will have to live in SRAM. */
| 33 | #if defined(_kinetis_) |
| 34 | /* This will have to live in SRAM. */ |
| 35 | __attribute__((section(".ramtext.ftfl_submit_cmd"), long_call)) |
| 36 | int ftfl_submit_cmd() |
| 37 | { |
| 38 | FTFL.fstat.raw = ((struct FTFL_FSTAT_t){ |
| 39 | .ccif = 1, |
| 40 | //.rdcolerr = 1, |
| 41 | .accerr = 1, |
| 42 | .fpviol = 1 |
| 43 | }).raw; |
| 44 | |
| 45 | // Wait for the operation to complete |
| 46 | struct FTFL_FSTAT_t stat; |
| 47 | while (!(stat = FTFL.fstat).ccif); // XXX maybe WFI? |
| 48 | |
| 49 | // Mask error bits |
| 50 | return stat.raw & (FTFL_FSTAT_RDCOLERR | FTFL_FSTAT_ACCERR | FTFL_FSTAT_FPVIOL | FTFL_FSTAT_MGSTAT0); |
| 51 | //return (!!stat.mgstat0); |
| 52 | } |
| 53 | |
| 54 | int flash_prepare_flashing() |
| 55 | { |
no outgoing calls
no test coverage detected
searching dependent graphs…