@@ -18,6 +18,10 @@ static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios);
1818#elif IS_ENABLED (CONFIG_SOC_NRF54H20_CPURAD )
1919static const struct gpio_dt_spec sw = GPIO_DT_SPEC_GET (DT_ALIAS (sw1 ), gpios );
2020static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET (DT_ALIAS (led1 ), gpios );
21+ #elif IS_ENABLED (CONFIG_SOC_NRF54H20_CPUPPR )
22+ static const struct gpio_dt_spec sw = GPIO_DT_SPEC_GET (DT_ALIAS (sw1 ), gpios );
23+ static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET (DT_ALIAS (led3 ), gpios );
24+
2125#else
2226#error "Invalid core selected. "
2327#endif
@@ -31,7 +35,7 @@ static K_SEM_DEFINE(my_gpio_sem, 0, 1);
3135void my_gpio_callback (const struct device * dev , struct gpio_callback * cb , uint32_t pins )
3236{
3337 gpio_pin_set_dt (& led , 1 );
34- LOG_INF ("User callback for %s\n " , CONFIG_BOARD_TARGET );
38+ LOG_INF ("User callback for %s" , CONFIG_BOARD_TARGET );
3539 k_sem_give (& my_gpio_sem );
3640}
3741
@@ -44,55 +48,55 @@ int main(void)
4448
4549 rc = gpio_is_ready_dt (& led );
4650 if (rc < 0 ) {
47- LOG_ERR ("GPIO Device not ready (%d)\n " , rc );
51+ LOG_ERR ("GPIO Device not ready (%d)" , rc );
4852 return 0 ;
4953 }
5054
5155 rc = gpio_pin_configure_dt (& led , GPIO_OUTPUT_ACTIVE );
5256 if (rc < 0 ) {
53- LOG_ERR ("Could not configure led GPIO (%d)\n " , rc );
57+ LOG_ERR ("Could not configure led GPIO (%d)" , rc );
5458 return 0 ;
5559 }
5660
5761#if DT_NODE_EXISTS (DT_PATH (zephyr_user ))
5862 rc = gpio_is_ready_dt (& fake_rts );
5963 if (rc < 0 ) {
60- LOG_ERR ("GPIO Device not ready (%d)\n " , rc );
64+ LOG_ERR ("GPIO Device not ready (%d)" , rc );
6165 return 0 ;
6266 }
6367
6468 rc = gpio_pin_configure_dt (& fake_rts , GPIO_OUTPUT_ACTIVE );
6569 if (rc < 0 ) {
66- LOG_ERR ("Could not configure fake_rst GPIO (%d)\n " , rc );
70+ LOG_ERR ("Could not configure fake_rst GPIO (%d)" , rc );
6771 return 0 ;
6872 }
6973#endif
7074
7175 rc = gpio_is_ready_dt (& sw );
7276 if (rc < 0 ) {
73- LOG_ERR ("GPIO Device not ready (%d)\n " , rc );
77+ LOG_ERR ("GPIO Device not ready (%d)" , rc );
7478 return 0 ;
7579 }
7680
7781 rc = gpio_pin_configure_dt (& sw , GPIO_INPUT );
7882 if (rc < 0 ) {
79- LOG_ERR ("Could not configure sw GPIO (%d)\n " , rc );
83+ LOG_ERR ("Could not configure sw GPIO (%d)" , rc );
8084 return 0 ;
8185 }
8286
8387 rc = gpio_pin_interrupt_configure (sw .port , sw .pin , GPIO_INT_LEVEL_ACTIVE );
8488 if (rc < 0 ) {
85- LOG_ERR ("Could not configure sw GPIO interrupt (%d)\n " , rc );
89+ LOG_ERR ("Could not configure sw GPIO interrupt (%d)" , rc );
8690 return 0 ;
8791 }
8892 gpio_init_callback (& gpio_cb , my_gpio_callback , 0xFFFF );
8993 gpio_add_callback (sw .port , & gpio_cb );
90- LOG_INF ("Multicore idle_gpio test on %s\n " , CONFIG_BOARD_TARGET );
94+ LOG_INF ("Multicore idle_gpio test on %s" , CONFIG_BOARD_TARGET );
9195 while (1 ) {
92- LOG_INF ("Multicore idle_gpio test iteration %u\n " , cnt ++ );
96+ LOG_INF ("Multicore idle_gpio test iteration %u" , cnt ++ );
9397 gpio_pin_set_dt (& led , 0 );
9498 if (k_sem_take (& my_gpio_sem , K_FOREVER ) != 0 ) {
95- LOG_ERR ("Failed to take a semaphore\n " );
99+ LOG_ERR ("Failed to take a semaphore" );
96100 return 0 ;
97101 }
98102 k_busy_wait (1000000 );
0 commit comments