adjust buf_len and inactive_time range
This commit is contained in:
+3
-3
@@ -54,7 +54,7 @@ void config_valid() {
|
||||
body->speaker_volume = 2.0f;
|
||||
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;
|
||||
printf("[Config] Inactive time is invalid\n");
|
||||
}
|
||||
@@ -70,8 +70,8 @@ void config_valid() {
|
||||
body->polling_rate_mode = 0;
|
||||
printf("[Config] polling_rate_mode is invalid\n");
|
||||
}
|
||||
if (body->haptics_buffer_length < 16 || body->haptics_buffer_length > 255) {
|
||||
body->haptics_buffer_length = 48;
|
||||
if (body->haptics_buffer_length < 16 || body->haptics_buffer_length > 128) {
|
||||
body->haptics_buffer_length = 64;
|
||||
printf("[Config] haptics_buffer_length is invalid\n");
|
||||
}
|
||||
if (body->controller_mode > 1) {
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ struct __attribute__((packed)) Config_body {
|
||||
uint8_t disable_inactive_disconnect; // bool: 0 disable,1 enable
|
||||
uint8_t disable_pico_led; // bool
|
||||
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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user