aboutsummaryrefslogtreecommitdiff
path: root/main/i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/i2c.c')
-rw-r--r--main/i2c.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/main/i2c.c b/main/i2c.c
index ccd6b46..612075b 100644
--- a/main/i2c.c
+++ b/main/i2c.c
@@ -9,15 +9,19 @@
#include "i2c.h"
#include "pb-mod.h"
#include "pbdrv.h"
+#include "config.h"
+
+i2c_addr_t modules[CFG_PB_MOD_MAX];
+size_t modules_size = 0;
void bus_task() {
- vTaskDelay(1000 / portTICK_PERIOD_MS);
-
bus_scan();
vTaskDelete(NULL);
}
void pb_route_cmd_magic_res(pb_msg_t * msg) {
- printf("got a magic response from 0x%02x!\n", msg->sender);
+ if (modules_size == CFG_PB_MOD_MAX) return;
+ modules[modules_size++] = msg->sender;
+ printf("i2c: registered puzzle module w/ address 0x%02x\n", msg->sender);
}