I have received a code handover and was just reviewing and found something strange. Pin D5 is configured as pull-down and interrupt on rising edge. The device uses pin D5 to wake from System.sleep(). However, in the System.sleep() API reference (Here) it says D5 cannot be used as a wake from sleep pin on the Electron ( D1- D4 are). However, the device runs perfectly fine and is able to wake whenever 3.3V is applied to D5. How is this working?
Also, when I change D5 to be pull-down with interrupt on changing edge, the device perfroms the interrupt fine while it is awake. However as soon as the device calls System.sleep() the interrupt is triggered then will not trigger again while sleeping. This points to D5 becoming a floating/pull-up pin when in sleep mode, but then how is the original setup of pull-down and rising edge interrupt working?
Edit: am using an E310 Module