Skip to content

Commit

Permalink
Last commit before release v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo Casanova committed Oct 5, 2018
1 parent a580772 commit 54e9eea
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion timonel-bootloader/releases/tml-bootloader.hex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
:101B90008FEF99C0873A09F449C0883AC9F787E5B9
:101BA00067D1809165008860809365002CC0FE013C
:101BB000339685E0DF011D928A95E9F78CE58983EC
:101BC00084E58A8381E08B8382E68D838BE18E833B
:101BC00084E58A8381E08B8382E28D838BE18E833F
:101BD000EFEFFAE184918887EEEFFAE1849189874B
:101BE000809165008160809365008E010F5F1F4FBB
:101BF0007E01BAE0EB0EF11CF80181918F0138D122
Expand Down
13 changes: 8 additions & 5 deletions timonel-bootloader/tml-bootloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
#if (PAGE_SIZE > 64)
#error "Timonel only supports pagesizes up to 64 bytes"
#endif

#if (!(AUTO_TPL_CALC) && !(CMD_STPGADDR))
#error "If the AUTO_TPL_CALC option is disabled, then CMD_STPGADDR must be enabled in tml-config.h!"
#endif

#ifndef F_CPU
#define F_CPU 8000000UL /* Default CPU speed */
Expand Down Expand Up @@ -187,8 +191,7 @@ int main() {
}
#if APP_USE_TPL_PG
if ((flashPageAddr) == (TIMONEL_START - PAGE_SIZE)) {
// - Read the previous page to the bootloader start.
// - Write it to the temporary buffer.
// - Read the previous page to the bootloader start, write it to the temporary buffer.
const __flash unsigned char * flashAddr;
for (byte i = 0; i < PAGE_SIZE - 2; i += 2) {
flashAddr = (void *)((TIMONEL_START - PAGE_SIZE) + i);
Expand Down Expand Up @@ -277,9 +280,9 @@ void RequestEvent(void) {
reply[7] = (*flashAddr & 0xFF); /* Trampoline second byte (MSB) */
reply[8] = (*(--flashAddr) & 0xFF); /* Trampoline first byte (LSB) */
#if CHECK_EMPTY_FL
for (uint16_t i = 0; i < 100; i++) {
flashAddr = (void *)(i);
reply[9] += (byte)~(*flashAddr); /* Check the first 100 bytes to check if there is an app flashed */
for (word mPos = 0; mPos < 100; mPos++) { /* Check the first 100 memory positions to determine if */
flashAddr = (void *)(mPos); /* there is an application (or some other data) loaded. */
reply[9] += (byte)~(*flashAddr);
}
#endif /* CHECK_EMPTY_FL */
#if !(TWO_STEP_INIT)
Expand Down
12 changes: 6 additions & 6 deletions timonel-bootloader/tml-t85-std/tml-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

/*
====== The configuration of the next optional features can be checked
====== from the I2C master by using the GETTMNLV command.
====== from the I2C master by using the GETTMNLV command ...
*/

#define ENABLE_LED_UI false /* If this is enabled, LED_UI_PIN is used to display Timonel activity. */
Expand All @@ -50,7 +50,8 @@

#define USE_WDT_RESET true /* Use watchdog for resetting instead of jumping to TIMONEL_START. */

#define SET_PRESCALER true /* Force setting the CPU clock prescaler for 8 MHz . */
#define CHECK_EMPTY_FL false /* GETTMNLV will read the first 100 flash memory positions to check if */
/* there is an application (or some other data) loaded. */

#define CMD_MEM_DUMP false /* TO IMPLEMENT IN NEXT VERSIONS: this option will enable a command to */
/* dump all the flash memory contents, except the bootloader section. */
Expand All @@ -60,11 +61,10 @@
====== shown in the GETTMNLV command.
*/

#define SET_PRESCALER true /* Force setting the CPU clock prescaler for 8 MHz . */

#define FORCE_ERASE_PG false /* If this option is enabled, each flash memory page is erased before */
/* writing new data. Normally, it shouldn't be necessary to enable it. */

#define CHECK_EMPTY_FL false /* Check the first 100 bytes of flash memory to determine if there is */
/* an applications (or some other data) loaded. */

/* ---------------------------------------------------------------------------------- */
/* --- Timonel internal configuration. Do not change anything below this line --- */
Expand Down Expand Up @@ -152,7 +152,7 @@
#else
#define FT_BIT_5 0
#endif
#if (SET_PRESCALER == true)
#if (CHECK_EMPTY_FL == true)
#define FT_BIT_6 64
#else
#define FT_BIT_6 0
Expand Down

0 comments on commit 54e9eea

Please sign in to comment.