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

what's the function of the code *(uint32_t *)0x40008C0C = 1

hi, what's the function of the code *(uint32_t *)0x40008C0C = 1 in GPIOTE example of SDK 9.0,

and i know the address of 0x40008000 is TIMER0, and i check the another timer example of

SDK9.0, it donot need this code. if you want to set the field of timer struct,why not use the

dot form of struct?

/**

  • @brief Function for application main entry. */ int main(void) { ret_code_t err_code;

    err_code = nrf_drv_ppi_init(); APP_ERROR_CHECK(err_code);

    err_code = nrf_drv_gpiote_init(); APP_ERROR_CHECK(err_code);

    err_code = nrf_drv_timer_init(&timer, NULL, timer_dummy_handler); APP_ERROR_CHECK(err_code); *(uint32_t *)0x40008C0C = 1;

    // Setup PPI channel with event from TIMER compare and task GPIOTE pin toggle. led_blinking_setup();

    // Enable timer nrf_drv_timer_enable(&timer);

    while (true) { // Do Nothing - GPIO can be toggled without software intervention. } }

Related