MCPcopy Create free account
hub / github.com/kiibohd/controller / ftfl_submit_cmd

Function ftfl_submit_cmd

Bootloader/flash.c:35–52  ·  view source on GitHub ↗

This will have to live in SRAM. */

Source from the content-addressed store, hash-verified

33#if defined(_kinetis_)
34/* This will have to live in SRAM. */
35__attribute__((section(".ramtext.ftfl_submit_cmd"), long_call))
36int 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
54int flash_prepare_flashing()
55{

Callers 5

flash_prepare_flashingFunction · 0.85
flash_read_1s_sectorFunction · 0.85
flash_erase_sectorFunction · 0.85
flash_program_sectionFunction · 0.85
sector_printFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…