Skip to content

Commit

Permalink
Puck.js: ensure self test only happens after hardware reset (fix #2001)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Jun 18, 2021
1 parent 9c2c373 commit efb28ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -20,6 +20,7 @@
Storage: fix issue where functions referencing flash weren't correctly relocated during compact (#2009)
Add support for rendering 3 bit images to 12/16 bit destinations
Ensure Serial1.unsetup can be called even if it doesn't appear to have been enabled
Puck.js: ensure self test only happens after hardware reset (fix #2001)

2v09 : Bangle.js: increase default advertising interval from 375 to 200ms to ease connections
Fix Math.acos for negative values (fix #1950)
Expand Down
4 changes: 2 additions & 2 deletions libs/puckjs/jswrap_puck.c
Expand Up @@ -1551,9 +1551,9 @@ void jswrap_puck_init() {

/* If the button is pressed during reset, perform a self test.
* With bootloader this means apply power while holding button for >3 secs */
static bool firstStart = true;
bool firstStart = jsiStatus & JSIS_FIRST_BOOT; // is this the first time jswrap_puck_init was called?;
if (firstStart && jshPinGetValue(BTN1_PININDEX) == BTN1_ONSTATE) {
firstStart = false; // don't do it during a software reset - only first hardware reset
// don't do it during a software reset - only first hardware reset
bool result = jswrap_puck_selfTest();
// green if good, red if bad
Pin indicator = result ? LED2_PININDEX : LED1_PININDEX;
Expand Down

0 comments on commit efb28ac

Please sign in to comment.