Skip to content

Commit ac68fba

Browse files
committed
Initialize ffb rate dividers always
Fixes DISCO infinite loop in clean state
1 parent e92c040 commit ac68fba

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Firmware/FFBoard/UserExtensions/Inc/FFBHIDMain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class FFBHIDMain: public FFBoardMain, public cpp_freertos::Thread, PersistentSto
103103
uint8_t usb_report_rate = HID_BINTERVAL; //for FS USB 1 = 1000hz, 2 = 500hz, 3 = 333hz 4 = 250hz, 5 = 200hz 6 = 166hz, 8 = 125hz etc...
104104
uint8_t usb_report_rate_idx = ffbrates.defaultmode;
105105
#ifndef TIM_FFB
106-
uint8_t ffb_rate_divider = 0;
106+
uint8_t ffb_rate_divider = 1;
107107
uint8_t ffb_rate_counter = 0;
108108
#endif
109109

Firmware/FFBoard/UserExtensions/Src/FFBHIDMain.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ void FFBHIDMain::restoreFlash(){
7878
if(Flash_Read(ADR_FFBWHEEL_CONF1,&conf1)){
7979
uint8_t rateidx = conf1 & 0x3;
8080
setReportRate(rateidx);
81+
}else{
82+
setReportRate(0); // default
8183
}
8284

8385
}

0 commit comments

Comments
 (0)