24 Thread(
"FFBMAIN", 256, 30),
65 uint8_t rateidx = conf1 & 0x3;
87 bool estopState = HAL_GPIO_ReadPin(E_STOP_GPIO_Port, E_STOP_Pin) == GPIO_PIN_RESET;
138 return this->
ffb->getRate();
142 return this->
ffb->getFfbActive();
167 std::vector<int32_t>* axes =
axes_manager->getAxisValues();
169 for(
auto val : *axes){
175 for(int32_t val : *axes){
217 s += std::to_string(1000/(HID_BINTERVAL*
usb_report_rates[i])) +
"Hz:"+std::to_string(i);
252 if(
control.
emergency && HAL_GPIO_ReadPin(E_STOP_GPIO_Port, E_STOP_Pin) != GPIO_PIN_RESET){
263 if(GPIO_Pin == BUTTON_A_Pin){
265 if(HAL_GPIO_ReadPin(BUTTON_A_GPIO_Port, BUTTON_A_Pin)){
270 if(GPIO_Pin == E_STOP_Pin){
272 bool estopPinState = HAL_GPIO_ReadPin(E_STOP_GPIO_Port, E_STOP_Pin) == GPIO_PIN_RESET;
osThreadId_t defaultTaskHandle
std::shared_ptr< EffectsControlItf > ffb
void setReportRate(uint8_t rateidx)
std::string usb_report_rates_names()
void exti(uint16_t GPIO_Pin)
volatile Control_t control
reportHID_t lastReportHID
volatile uint32_t lastEstop
uint8_t usb_report_rate_idx
std::unique_ptr< AxesManager > axes_manager
const bool allowEstopReset
void setFFBEffectsCalc(std::shared_ptr< EffectsControlItf > ffb, std::shared_ptr< EffectsCalculator > effects_calc)
const uint8_t analogAxisCount
FFBHIDMain(uint8_t axisCount)
std::shared_ptr< EffectsCalculator > effects_calc
void errorCallback(const Error &error, bool cleared)
void emergencyStop(bool reset)
const uint8_t usb_report_rates[4]
std::unique_ptr< HID_CommandInterface > hidCommands
uint8_t reportSendCounter
void restoreFlashDelayed()
void Delay(const TickType_t Delay)
void setHidReportAxis(reportHID_t *report, uint8_t idx, int16_t val)
bool Flash_Write(uint16_t adr, uint16_t dat)
bool Flash_Read(uint16_t adr, uint16_t *buf, bool checkempty=true)
bool tud_hid_n_ready(uint8_t instance)
static TU_ATTR_ALWAYS_INLINE bool tud_hid_report(uint8_t report_id, void const *report, uint16_t len)
bool request_update_disabled