Revert changes
This commit is contained in:
parent
6d92da3a10
commit
19f51f13c4
|
@ -10,13 +10,6 @@
|
|||
#include "tx_api.h"
|
||||
#include "vehicle.h"
|
||||
|
||||
// TODO Remove for STW v2
|
||||
#define MOCK_NUM_BUTTONS 5
|
||||
#define MOCK_BUTTON_TICK_CHANGE 1000
|
||||
uint32_t last_tick = 0;
|
||||
uint8_t mock_button_counter = 0;
|
||||
// END TODO
|
||||
|
||||
void ui_thread_entry(ULONG _) {
|
||||
GPIO_TypeDef *button_ports[NUM_BUTTONS] = {BTN1_GPIO_Port, BTN2_GPIO_Port,
|
||||
BTN3_GPIO_Port, BTN4_GPIO_Port,
|
||||
|
@ -51,22 +44,7 @@ void ui_thread_entry(ULONG _) {
|
|||
tx_event_flags_set(&gui_update_events, GUI_UPDATE_NEXT_SCREEN, TX_OR);
|
||||
}
|
||||
|
||||
// TODO restore this for STW24-v2
|
||||
// vehicle_broadcast_buttons(button_states);
|
||||
// END TODO
|
||||
|
||||
// TODO (STW24) Remove for STW24-v2 !!
|
||||
GPIO_PinState mock_button_states[MOCK_NUM_BUTTONS] = {mock_button_states};
|
||||
mock_button_states[mock_button_counter] = GPIO_PIN_SET;
|
||||
uint32_t now = HAL_GetTick();
|
||||
// Wait 1s before moving to the next button
|
||||
if (abs(now - last_tick) >= MOCK_BUTTON_TICK_CHANGE) {
|
||||
mock_button_counter++;
|
||||
mock_button_counter %= MOCK_NUM_BUTTONS;
|
||||
}
|
||||
|
||||
vehicle_broadcast_buttons(mock_button_states);
|
||||
// END TODO
|
||||
vehicle_broadcast_buttons(button_states);
|
||||
|
||||
// Release so other threads can get scheduled
|
||||
tx_thread_sleep(1);
|
||||
|
|
Loading…
Reference in New Issue