diff options
author | Maël Gassmann <mael.gassmann@students.bfh.ch> | 2024-09-07 23:59:49 +0200 |
---|---|---|
committer | Maël Gassmann <mael.gassmann@students.bfh.ch> | 2024-09-08 00:03:28 +0200 |
commit | 76d0db4dc32c5b77fa9622a408838ed5b85af68f (patch) | |
tree | af0b2cf27f6a8138aab5d6d6cf4e63f85f61475e | |
parent | 8cce9c35f37be9202480add526022126fcf02f0c (diff) |
[~] Fixed screen configuration mistake
-rw-r--r-- | components/screen/screen.c | 10 | ||||
-rw-r--r-- | main/main.c | 2 |
2 files changed, 7 insertions, 5 deletions
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); } diff --git a/main/main.c b/main/main.c index 4e73a00..1899256 100644 --- a/main/main.c +++ b/main/main.c @@ -7,5 +7,5 @@ void app_main(void) printf("Starting up...\n"); configure_screen(&screen); printf("Screen Configured!\n"); - display(&screen, "2110"); + test_screen(&screen); }
\ No newline at end of file |