@@ -36,33 +36,33 @@ int main(void)
3636{
3737 LOG_INF ("nrfx_gpiote sample on %s" , CONFIG_BOARD );
3838
39- nrfx_err_t err ;
39+ int err ;
4040 uint8_t in_channel , out_channel ;
4141 uint8_t ppi_channel ;
42- const nrfx_gpiote_t gpiote = NRFX_GPIOTE_INSTANCE (GPIOTE_INST );
42+ static nrfx_gpiote_t gpiote = NRFX_GPIOTE_INSTANCE (NRF_GPIOTE_INST_GET ( GPIOTE_INST ) );
4343
4444 /* Connect GPIOTE instance IRQ to irq handler */
45- IRQ_CONNECT (DT_IRQN (GPIOTE_NODE ), DT_IRQ (GPIOTE_NODE , priority ), nrfx_isr ,
46- NRFX_CONCAT ( nrfx_gpiote_ , GPIOTE_INST , _irq_handler ) , 0 );
45+ IRQ_CONNECT (DT_IRQN (GPIOTE_NODE ), DT_IRQ (GPIOTE_NODE , priority ), nrfx_gpiote_irq_handler ,
46+ & gpiote , 0 );
4747
4848 /* Initialize GPIOTE (the interrupt priority passed as the parameter
4949 * here is ignored, see nrfx_glue.h).
5050 */
5151 err = nrfx_gpiote_init (& gpiote , 0 );
52- if (err != NRFX_SUCCESS ) {
53- LOG_ERR ("nrfx_gpiote_init error: 0x%08X " , err );
52+ if (err != 0 ) {
53+ LOG_ERR ("nrfx_gpiote_init error: %d " , err );
5454 return 0 ;
5555 }
5656
5757 err = nrfx_gpiote_channel_alloc (& gpiote , & in_channel );
58- if (err != NRFX_SUCCESS ) {
59- LOG_ERR ("Failed to allocate in_channel, error: 0x%08X " , err );
58+ if (err != 0 ) {
59+ LOG_ERR ("Failed to allocate in_channel, error: %d " , err );
6060 return 0 ;
6161 }
6262
6363 err = nrfx_gpiote_channel_alloc (& gpiote , & out_channel );
64- if (err != NRFX_SUCCESS ) {
65- LOG_ERR ("Failed to allocate out_channel, error: 0x%08X " , err );
64+ if (err != 0 ) {
65+ LOG_ERR ("Failed to allocate out_channel, error: %d " , err );
6666 return 0 ;
6767 }
6868
@@ -85,8 +85,8 @@ int main(void)
8585
8686 err = nrfx_gpiote_input_configure (& gpiote , INPUT_PIN , & input_config );
8787
88- if (err != NRFX_SUCCESS ) {
89- LOG_ERR ("nrfx_gpiote_input_configure error: 0x%08X " , err );
88+ if (err != 0 ) {
89+ LOG_ERR ("nrfx_gpiote_input_configure error: %d " , err );
9090 return 0 ;
9191 }
9292
@@ -106,8 +106,8 @@ int main(void)
106106 err = nrfx_gpiote_output_configure (& gpiote , OUTPUT_PIN ,
107107 & output_config ,
108108 & task_config );
109- if (err != NRFX_SUCCESS ) {
110- LOG_ERR ("nrfx_gpiote_output_configure error: 0x%08X " , err );
109+ if (err != 0 ) {
110+ LOG_ERR ("nrfx_gpiote_output_configure error: %d " , err );
111111 return 0 ;
112112 }
113113
0 commit comments