adjust buf_len and inactive_time range

This commit is contained in:
awalol
2026-05-07 18:52:53 +08:00
parent 767e7437f7
commit 8155ebdfec
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -54,7 +54,7 @@ void config_valid() {
body->speaker_volume = 2.0f; body->speaker_volume = 2.0f;
printf("[Config] Speaker Volume is invalid\n"); printf("[Config] Speaker Volume is invalid\n");
} }
if (body->inactive_time < 10 || body->inactive_time > 60) { if (body->inactive_time < 5 || body->inactive_time > 60) {
body->inactive_time = 30; body->inactive_time = 30;
printf("[Config] Inactive time is invalid\n"); printf("[Config] Inactive time is invalid\n");
} }
@@ -70,8 +70,8 @@ void config_valid() {
body->polling_rate_mode = 0; body->polling_rate_mode = 0;
printf("[Config] polling_rate_mode is invalid\n"); printf("[Config] polling_rate_mode is invalid\n");
} }
if (body->haptics_buffer_length < 16 || body->haptics_buffer_length > 255) { if (body->haptics_buffer_length < 16 || body->haptics_buffer_length > 128) {
body->haptics_buffer_length = 48; body->haptics_buffer_length = 64;
printf("[Config] haptics_buffer_length is invalid\n"); printf("[Config] haptics_buffer_length is invalid\n");
} }
if (body->controller_mode > 1) { if (body->controller_mode > 1) {
+1 -1
View File
@@ -14,7 +14,7 @@ struct __attribute__((packed)) Config_body {
uint8_t disable_inactive_disconnect; // bool: 0 disable,1 enable uint8_t disable_inactive_disconnect; // bool: 0 disable,1 enable
uint8_t disable_pico_led; // bool uint8_t disable_pico_led; // bool
uint8_t polling_rate_mode; // 0: 250Hz, 1: 500Hz, 2: real-time uint8_t polling_rate_mode; // 0: 250Hz, 1: 500Hz, 2: real-time
uint8_t haptics_buffer_length; // [16,255] uint8_t haptics_buffer_length; // [16,128]
uint8_t controller_mode; // 0: DS5, 1: DSE 自动切换识别太麻烦了,懒的做了,期待pr uint8_t controller_mode; // 0: DS5, 1: DSE 自动切换识别太麻烦了,懒的做了,期待pr
}; };