Add code for constant CAN message sending
This commit is contained in:
parent
3f67d1571b
commit
9ef44b8ebb
|
@ -1,14 +1,18 @@
|
|||
#include "ui.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "hx8357d.h"
|
||||
#include "main.h"
|
||||
#include "stm32h7a3xx.h"
|
||||
#include "stm32h7xx_hal.h"
|
||||
#include "stm32h7xx_hal_gpio.h"
|
||||
#include "tx_api.h"
|
||||
|
||||
#include "hx8357d.h"
|
||||
#include "main.h"
|
||||
#include "vehicle.h"
|
||||
#include <stdint.h>
|
||||
|
||||
// TODO Remove for STW v2
|
||||
#define MOCK_NUM_BUTTONS 5
|
||||
uint8_t mock_button_counter = 0;
|
||||
|
||||
void ui_thread_entry(ULONG _) {
|
||||
GPIO_TypeDef *button_ports[NUM_BUTTONS] = {BTN1_GPIO_Port, BTN2_GPIO_Port,
|
||||
|
@ -43,9 +47,19 @@ void ui_thread_entry(ULONG _) {
|
|||
if (press_event == 1 && button_states[1]) {
|
||||
tx_event_flags_set(&gui_update_events, GUI_UPDATE_NEXT_SCREEN, TX_OR);
|
||||
}
|
||||
vehicle_broadcast_buttons(button_states);
|
||||
|
||||
// TODO restore this for STW24-v2
|
||||
// vehicle_broadcast_buttons(button_states);
|
||||
// Release so other threads can get scheduled
|
||||
tx_thread_sleep(1);
|
||||
// tx_thread_sleep(1);
|
||||
|
||||
// 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;
|
||||
mock_button_counter++;
|
||||
mock_button_counter %= MOCK_NUM_BUTTONS;
|
||||
vehicle_broadcast_buttons(mock_button_states);
|
||||
tx_thread_sleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue