Update hello world switch ports and default state - Align the port definitions with actual switches on Nexus, and initialize the GPIO state by reading instead of always-zero (otherwise, on real hardware we always get a spurious change - since the switches are high when not pressed). Change-Id: I7d3323a2d4cb60fbb03906c596ff0c817f2366ae
diff --git a/sw/device/examples/hello_world/hello_world.c b/sw/device/examples/hello_world/hello_world.c index e24c7a8..216178b 100644 --- a/sw/device/examples/hello_world/hello_world.c +++ b/sw/device/examples/hello_world/hello_world.c
@@ -32,10 +32,10 @@ }; static dif_pinmux_index_t switches[] = { - kTopMatchaPinmuxInselIoc8, - kTopMatchaPinmuxInselIoc5, - kTopMatchaPinmuxInselIoa2, - kTopMatchaPinmuxInselIoa3, + kTopMatchaPinmuxInselIor5, + kTopMatchaPinmuxInselIor6, + kTopMatchaPinmuxInselIor7, + kTopMatchaPinmuxInselIor10, }; void configure_pinmux(void) { @@ -116,7 +116,8 @@ CHECK_DIF_OK(dif_spi_device_send(&spi, "SPI!", 4, /*bytes_sent=*/NULL)); - uint32_t gpio_state = 0; + uint32_t gpio_state; + CHECK_DIF_OK(dif_gpio_read_all(&gpio, &gpio_state)); while (true) { busy_spin_micros(10 * 1000); // 10 ms gpio_state = demo_gpio_to_log_echo(&gpio, gpio_state);