diff options
| -rw-r--r-- | Inc/devices.h | 8 | ||||
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | Src/main-hs.c | 5 |
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 @@ -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 -----------------------------------------------*/ |
