File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
stm32-modules/vacuum-module/firmware Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ set(${TARGET_MODULE_NAME}_FW_NONLINTABLE_SRCS
4242 ${COMMS_DIR} /usbd_conf.c
4343 ${COMMS_DIR} /usbd_desc.c
4444 ${COMMS_DIR} /usb_hardware.c
45+ ${VACUUM_PS_DIR} /vacuum_pressure_sensor_hardware.c
4546 )
4647
4748add_executable (${TARGET_MODULE_NAME}
Original file line number Diff line number Diff line change 1+ #include <stdbool.h>
2+
3+ #include "stm32g4xx_hal.h"
4+ #include "stm32g4xx_hal_conf.h"
5+ #include "stm32g4xx_hal_gpio.h"
6+ #include "stm32g4xx_hal_def.h"
17#include "systemwide.h"
8+ #include "main.h"
29
310void vacuum_pressure_sensor_hardware_init (void ) {
411 GPIO_InitTypeDef GPIO_InitStruct = {0 };
@@ -37,17 +44,18 @@ void vacuum_pressure_sensor_hardware_init(void) {
3744
3845
3946bool sensor_hardware_read_eoc_pin (VacuumPressureSensorId sensor_id ) {
40- if (sensor_id == VacuumPressureSensorId ::SensorA ) {
41- uint8_t pin_val = HAL_GPIO_ReadPin (SENSOR_A_EOC_PORT , SENSOR_A_EOC_PIN );
47+ uint8_t pin_val ;
48+ if (sensor_id == SensorA ) {
49+ pin_val = HAL_GPIO_ReadPin (SENSOR_A_EOC_PORT , SENSOR_A_EOC_PIN );
4250 }
4351 else {
44- uint8_t pin_val = HAL_GPIO_ReadPin (SENSOR_B_EOC_PORT , SENSOR_B_EOC_PIN );
52+ pin_val = HAL_GPIO_ReadPin (SENSOR_B_EOC_PORT , SENSOR_B_EOC_PIN );
4553 }
4654 return pin_val == GPIO_PIN_SET ? true : false;
4755}
4856
4957void sensor_hardware_sensor_reset (VacuumPressureSensorId sensor_id ) {
50- if (sensor_id == VacuumPressureSensorId :: SensorA ) {
58+ if (sensor_id == SensorA ) {
5159 HAL_GPIO_WritePin (SENSOR_A_RESET_PORT , SENSOR_A_RESET_PIN , GPIO_PIN_RESET );
5260 }
5361 else {
You can’t perform that action at this time.
0 commit comments