File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
libraries/Bluefruit52Lib/examples/Peripheral/ancs_oled Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -106,12 +106,12 @@ uint32_t setLoopStacksize(void);
106
106
107
107
#define bit (b ) (1UL << (b))
108
108
109
- #define digitalPinToPort (P ) ( &(NRF_GPIO[P]) )
110
- #define digitalPinToBitMask (P ) ( 1 << g_ADigitalPinMap[P] )
109
+ #define digitalPinToPort (P ) ( NRF_P0 )
110
+ #define digitalPinToBitMask (P ) ( 1 << (P) )
111
111
//#define analogInPinToBit(P) ( )
112
- #define portOutputRegister (port ) ( &(NRF_GPIO ->OUT) )
113
- #define portInputRegister (port ) ( &(NRF_GPIO ->IN) )
114
- #define portModeRegister (port ) ( &(NRF_GPIO->DIRSET ) )
112
+ #define portOutputRegister (port ) ( &(port ->OUT) )
113
+ #define portInputRegister (port ) ( &(port ->IN) )
114
+ #define portModeRegister (port ) ( &(port->DIR ) )
115
115
#define digitalPinHasPWM (P ) ( (P) > 1 )
116
116
117
117
void rtos_idle_callback (void ) ATTR_WEAK ;
Original file line number Diff line number Diff line change @@ -410,7 +410,7 @@ uint32_t readPressedButtons(void)
410
410
411
411
// Take current read and masked with BUTTONs
412
412
// Note: Bitwise inverted since buttons are active (pressed) LOW
413
- uint32_t debounced = ~(*portInputRegister (0 ));
413
+ uint32_t debounced = ~(*portInputRegister ( digitalPinToPort ( 0 ) ));
414
414
debounced &= (bit (BUTTON_A) | bit (BUTTON_B) | bit (BUTTON_C));
415
415
416
416
// Copy current state into array
You can’t perform that action at this time.
0 commit comments