summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAditya Naik2020-04-07 00:22:19 -0400
committerAditya Naik2020-04-07 00:22:19 -0400
commit88e041cb910f5d238cd5775921a339f529cbc3b1 (patch)
tree35a205422bc7aa573ff25bc452aed1d75053a6bc
parent3a725dcadf2de4eb3de0634fd82ce27daafa20d7 (diff)
Working on MDR decoding in main-hs
-rw-r--r--Inc/devices.h8
-rw-r--r--Makefile2
-rw-r--r--Src/main-hs.c5
3 files changed, 13 insertions, 2 deletions
diff --git a/Inc/devices.h b/Inc/devices.h
index 3b54580..396ae2d 100644
--- a/Inc/devices.h
+++ b/Inc/devices.h
@@ -29,5 +29,13 @@ typedef enum hs_status {
HS_FAILED = 5
} hs_status_t;
+typedef enum state {
+ OFFLINE = 0, /* Device not found on bus */
+ CONNECTED = 1, /* Device found on bus but handshake not completed */
+ REGISTERED = 2, /* Completed handshake; ready for action */
+ HS_FAILED = 3, /* Handshake failed */
+ NO_DATA = 4 /* ??? */
+} state_t;
+
/* Handshake message size definitions */
#define MDR_req_buf_len 2
diff --git a/Makefile b/Makefile
index 250032c..c6a1ab6 100644
--- a/Makefile
+++ b/Makefile
@@ -54,7 +54,7 @@ Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c \
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c \
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c \
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c \
-Src/main.c \
+Src/main-hs.c \
Src/stm32f4xx_it.c \
Src/stm32f4xx_hal_msp.c \
Src/system_stm32f4xx.c \
diff --git a/Src/main-hs.c b/Src/main-hs.c
index 5962b9b..7db3e7a 100644
--- a/Src/main-hs.c
+++ b/Src/main-hs.c
@@ -60,7 +60,10 @@ I2C_HandleTypeDef hi2c1;
UART_HandleTypeDef huart1;
/* USER CODE BEGIN PV */
-
+device_info_t *device_info[128] = {NULL};
+subscription_info_t* subs_info[128];
+uint32_t allocated[4]={0};
+/* uint8_t dev_sts[128] = {OFFLINE}; */
/* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/