This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ncs zephyr example called 'nrfx'

ncs 1.5.1, using SES, the example for zephyr
samples/boards/nrf/nrfx/src/main.c
github URL:
github.com/.../main.c

does not work for me;
while the 'button_handler' gets called OK, the LED does not toggle.

And another compiler gives a WARNING on the call lines for n
  nrfx_gppi_channel_endpoints_setup 
due types mismatch!
I think its the last argument per 
nrfx_gpiote_in_event_get(OUTPUT_PIN) 
that should be of enum nrf_gpiote_task_t, but your code is passing an 'event' kind.
I tried to fix but still no LED toggle.

Please review this example.

Thanks!

Parents Reply
  • C compilers do not check for enum type mismatch; In my case it is the additional CLang based verifier running. 

    I ask again, why should we code for an IN -event on a !OUTPUT! pin?
    nrfx_gpiote_in_event_get (OUTPUT_PIN)

    While looking at the nrfx implementation, I think it worked (for you) due pure coincidence as the offsets of the channels/registers are the same.

    Another point on this line is the mixture of nrfx_* vs nrf_* calls,
    I think it would be much better readable as:
      nrfx_gppi_channel_endpoints_setup(channel,
           nrfx_gpiote_in_event_addr_get(INPUT_PIN),
           nrfx_gpiote_out_task_addr_get(OUTPUT_PIN) );

Children
No Data
Related