Skip to content

Commit

Permalink
oops - fix build on non-nRF52 devices
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Nov 18, 2024
1 parent 4a02875 commit 0300f65
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/jswrap_espruino.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,12 +705,14 @@ Called when a bit rises or falls above a set level. See `E.setComparator` for se
}
*/
void jswrap_espruino_setComparator_eventHandler(IOEvent *event) {
#if defined(NRF52_SERIES) && !defined(SAVE_ON_FLASH)
// see jshSetComparator / E.setComparator
if ((event->data.time & EVC_TYPE_MASK) == EVC_LPCOMP) {
JsVar *arg = jsvNewFromInteger((event->data.time & EVC_DATA_LPCOMP_UP) ? 1 : -1);
jsiExecuteEventCallbackOn("E",JS_EVENT_PREFIX"comparator",1,&arg);
jsvUnLock(arg);
}
#endif
}
/*JSON{
"type" : "staticmethod",
Expand Down

0 comments on commit 0300f65

Please sign in to comment.