You are reading a single comment by @Wilberforce and its replies. Click here to read the full conversation.
  • @Gordon
    In debug mode build, an Assert is failing here:

    >setWatch(function() {console.log('bang!')}, D22, {repeat:true});
    ASSERT(channel>=EV_EXTI0 && channel<=EV_EXTI_MAX) FAILED AT src/jsdevices.c:706
      #1[r2,l2] Object {
        #2[r1,l2] Name String [1 blocks] "\xFF"      #3[r1,l2] Object {
            #6[r1,l2] Name String [2 blocks] "timers"          #8[r2,l1] Array(0) [ ]
            #9[r1,l2] Name String [2 blocks] "watches"          #11[r2,l1] Array(0) [ ]
            #13[r1,l2] Name String [1 blocks] "net"          #14[r1,l2] String [1 blocks] "\x05\x00\x00\x00\x00\xFF\xFF\xFF"
            #25[r1,l2] Name String [2 blocks] "modules"          #27[r1,l1] Object {
                #29[r1,l2] Name String [1 blocks] "Wifi"              #28[r1,l1] NativeFunction 0x400ea898 (0) { }
              }
          }
      }
    HALTING.
    

    https://github.com/espruino/Espruino/blo­b/master/src/jsdevices.c#L706 ( line 6 below)

    void jshSetEventCallback(
        IOEventFlags channel,             //!< The event that fires the callback.
        JshEventCallbackCallback callback //!< The callback to be invoked.
      ) {
      // Save the callback function for this event channel.
      assert(channel>=EV_EXTI0 && channel<=EV_EXTI_MAX);
      jshEventCallbacks[channel-EV_EXTI0] = callback;
    }
    
    

    EV_EXTI_MAX is defined as: https://github.com/espruino/Espruino/blo­b/e609b94f83f665c26cf4f86acac068c396427e­99/src/jsdevices.h#L54

    EV_EXTI15, // External Interrupt 15
      EV_EXTI_MAX = EV_EXTI15,
    

    @JumJum did the setwatch code for ESP32 - so I'm unsure how pin numbers (D22 in this case) is mapping to a channel?

About

Avatar for Wilberforce @Wilberforce started