Skip to content

Commit

Permalink
Bangle.js2: Fix spurious tap events when HRM enabled by changing thre…
Browse files Browse the repository at this point in the history
…shold
  • Loading branch information
gfwilliams committed Nov 7, 2023
1 parent c24c4cb commit 57f3a91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Fix for UNFINISHED REGEX syntax error when parsing `true / false` (fix #2424)
Allow `throw undefined` to still show an exception in the REPL (fix #2423)
When parsing function declarations, don't interpret the strings inside them
Bangle.js2: Fix spurious tap events when HRM enabled by changing threshold

2v19 : Fix Object.values/entries for numeric keys after 2v18 regression (fix #2375)
nRF52: for SD>5 use static buffers for advertising and scan response data (#2367)
Expand Down
3 changes: 2 additions & 1 deletion libs/banglejs/jswrap_bangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -3926,7 +3926,8 @@ NO_INLINE void jswrap_banglejs_init() {
jswrap_banglejs_accelWr(0x24,3); // TDTRC Tap detect enable
jswrap_banglejs_accelWr(0x25, 0x78); // TDTC Tap detect double tap (0x78 default)
jswrap_banglejs_accelWr(0x26, 0xCB); // TTH Tap detect threshold high (0xCB default)
jswrap_banglejs_accelWr(0x27, 0x1A); // TTL Tap detect threshold low (0x1A default)
jswrap_banglejs_accelWr(0x27, 0x25); // TTL Tap detect threshold low (0x1A default)
// setting TTL=0x1A means that when the HRM is on, interference sometimes means a spurious tap is detected! https://forum.espruino.com/conversations/390041
jswrap_banglejs_accelWr(0x30,1); // ATH low wakeup detect threshold
//jswrap_banglejs_accelWr(0x35,0 << 4); // LP_CNTL no averaging of samples
jswrap_banglejs_accelWr(0x35,2 << 4); // LP_CNTL 4x averaging of samples
Expand Down

0 comments on commit 57f3a91

Please sign in to comment.