@@ -46,7 +46,6 @@ struct Commands {
4646 static const uint8_t READ_FLASH = 0x08 ;
4747};
4848
49- SelfProgram selfProgram;
5049volatile bool bootloaderExit = false ;
5150
5251static uint8_t writeBuffer[SPM_ERASESIZE];
@@ -55,7 +54,7 @@ static uint16_t nextWriteAddress = 0;
5554static bool equalToFlash (uint16_t address, uint8_t len) {
5655 uint8_t offset = 0 ;
5756 while (len > 0 ) {
58- if (writeBuffer[offset] != selfProgram. readByte (address + offset))
57+ if (writeBuffer[offset] != SelfProgram:: readByte (address + offset))
5958 return false ;
6059 --len;
6160 ++offset;
@@ -72,7 +71,7 @@ static uint8_t commitToFlash(uint16_t address, uint8_t len) {
7271 uint8_t offset = 0 ;
7372 while (len > 0 ) {
7473 uint8_t pageLen = len < SPM_PAGESIZE ? len : SPM_PAGESIZE;
75- uint8_t err = selfProgram. writePage (address + offset, &writeBuffer[offset], pageLen);
74+ uint8_t err = SelfProgram:: writePage (address + offset, &writeBuffer[offset], pageLen);
7675 if (err)
7776 return err;
7877 len -= pageLen;
@@ -174,7 +173,7 @@ cmd_result processCommand(uint8_t cmd, uint8_t *datain, uint8_t len, uint8_t *da
174173 dataout[2 ] = INFO_BL_VERSION;
175174 // Available flash size is up to startApplication.
176175 // Convert from words to bytes.
177- uint16_t size = selfProgram. applicationSize ;
176+ uint16_t size = SelfProgram:: applicationSize;
178177 dataout[3 ] = size >> 8 ;
179178 dataout[4 ] = size;
180179 return cmd_ok (5 );
@@ -237,7 +236,7 @@ cmd_result processCommand(uint8_t cmd, uint8_t *datain, uint8_t len, uint8_t *da
237236 if (len > maxLen)
238237 return cmd_result (Status::INVALID_ARGUMENTS);
239238
240- selfProgram. readFlash (address, dataout, len);
239+ SelfProgram:: readFlash (address, dataout, len);
241240 return cmd_ok (len);
242241 }
243242
0 commit comments