From 27fc91fbe8f88b6885356e68828cfe1ce1db7601 Mon Sep 17 00:00:00 2001 From: yy1717 <fctom1215@outlook.com> Date: 星期三, 28 二月 2024 09:53:13 +0800 Subject: [PATCH] 坐标 --- lib/src/main/cpp/test_common/car_sensor.h | 41 ++++++++++++++++------------------------- 1 files changed, 16 insertions(+), 25 deletions(-) diff --git a/lib/src/main/cpp/test_common/car_sensor.h b/lib/src/main/cpp/test_common/car_sensor.h index e15b183..dd6a976 100644 --- a/lib/src/main/cpp/test_common/car_sensor.h +++ b/lib/src/main/cpp/test_common/car_sensor.h @@ -20,9 +20,9 @@ MAIN_BEAM_LAMP, SEATBELT, ENGINE_START, - BREAK, - HAND_BREAK, - SECOND_BREAK, + BRAKE, + HAND_BRAKE, + SECOND_BRAKE, DOOR, SURROUND_CAR_1, SURROUND_CAR_2, @@ -31,25 +31,17 @@ CAR_STATUS_END ////////////// }; +#define LIGHT_OFF 0 +#define LIGHT_ON 1 +#define INACTIVE 0 +#define ACTIVE 1 +#define DOOR_OPEN 0 +#define DOOR_CLOSE 1 +#define EJECT 0 +#define INSERT 1 + // Value enum { - OFF_LIGHT = 0, - EJECT_SEATBELT = 0, - ENGINE_START_INACTIVE = 0, - BREAK_INACTIVE = 0, - DOOR_OPEN = 0, - SURROUND_CAR_INACTIVE = 0, - - HAZARD_LIGHTS, - LEFT_TURN_LIGHT, - RIGHT_TURN_LIGHT, - CLEARANCE_LIGHT, - DIPPED_BEAM_LIGHT, - MAIN_BEAM_LIGHT, - FLASH_BEAM_LIGHT, - FOG_LIGHT, - INSERT_SEATBELT, - ENGINE_START_ACTIVE, GEAR_N, GEAR_1, GEAR_2, @@ -57,9 +49,9 @@ GEAR_4, GEAR_5, GEAR_R, - BREAK_ACTIVE, - DOOR_CLOSE, - SURROUND_CAR_ACTIVE + HAZARD_LIGHTS, + LEFT_TURN_LIGHT, + RIGHT_TURN_LIGHT }; typedef struct { @@ -95,8 +87,7 @@ void CarSensorInit(void); int ReadCarStatus(uint16_t id); -void UpdateSensor(uint16_t gpio, uint16_t speed, uint16_t rpm); -void UpdateSensor(const car_sensor_t *s); +void UpdateSensorHw(const car_sensor_t *s); void SetSensorCfg(int (*sensor)[3], int sensorNum); -- Gitblit v1.8.0