From 76d0db4dc32c5b77fa9622a408838ed5b85af68f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gassmann?= Date: Sat, 7 Sep 2024 23:59:49 +0200 Subject: [~] Fixed screen configuration mistake --- components/screen/screen.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'components') diff --git a/components/screen/screen.c b/components/screen/screen.c index 99f74b0..8d29265 100644 --- a/components/screen/screen.c +++ b/components/screen/screen.c @@ -77,10 +77,12 @@ void configure_screen(struct Screen* screen) for (uint8_t i = 0; i <= 3; ++i) { - mcp_set_mode(screen->mcp, screen->nixies[i].reg, screen->nixies[i].D, MCP_GPIO_OUTPUT); - mcp_set_mode(screen->mcp, screen->nixies[i].reg, screen->nixies[i].C, MCP_GPIO_OUTPUT); - mcp_set_mode(screen->mcp, screen->nixies[i].reg, screen->nixies[i].B, MCP_GPIO_OUTPUT); - mcp_set_mode(screen->mcp, screen->nixies[i].reg, screen->nixies[i].A, MCP_GPIO_OUTPUT); + uint8_t reg = REG_IODIRA; + if (screen->nixies[i].reg != REG_GPIOA) reg = REG_GPIOB; + mcp_set_mode(screen->mcp, reg, screen->nixies[i].D, MCP_GPIO_OUTPUT); + mcp_set_mode(screen->mcp, reg, screen->nixies[i].C, MCP_GPIO_OUTPUT); + mcp_set_mode(screen->mcp, reg, screen->nixies[i].B, MCP_GPIO_OUTPUT); + mcp_set_mode(screen->mcp, reg, screen->nixies[i].A, MCP_GPIO_OUTPUT); } -- cgit v1.2.3