diff --git a/.github/hardware.py b/.github/hardware.py index 0fd0082..8f1f57f 100644 --- a/.github/hardware.py +++ b/.github/hardware.py @@ -107,10 +107,35 @@ class FieldType(Enum): "gsensor_stk8xxx": FieldType.BOOL, "thermal_lm75a": FieldType.BOOL, "pwm_outputs": FieldType.ARRAY, + "pwm_out_only": FieldType.BOOL, "vbat": FieldType.ADC, + "vbat_cal_min": FieldType.INT, + "vbat_cal_max": FieldType.INT, + "vbat_noreading": FieldType.INT, "vbat_offset": FieldType.INT, "vbat_scale": FieldType.INT, "vbat_atten": FieldType.INT, + "vsrc1": FieldType.ADC, + "vsrc1_cal_min": FieldType.INT, + "vsrc1_cal_max": FieldType.INT, + "vsrc1_noreading": FieldType.INT, + "vsrc1_offset": FieldType.INT, + "vsrc1_scale": FieldType.INT, + "vsrc1_atten": FieldType.INT, + "vsrc2": FieldType.ADC, + "vsrc2_cal_min": FieldType.INT, + "vsrc2_cal_max": FieldType.INT, + "vsrc2_noreading": FieldType.INT, + "vsrc2_offset": FieldType.INT, + "vsrc2_scale": FieldType.INT, + "vsrc2_atten": FieldType.INT, + "vsrc3": FieldType.ADC, + "vsrc3_cal_min": FieldType.INT, + "vsrc3_cal_max": FieldType.INT, + "vsrc3_noreading": FieldType.INT, + "vsrc3_offset": FieldType.INT, + "vsrc3_scale": FieldType.INT, + "vsrc3_atten": FieldType.INT, "vtx_amp_pwm": FieldType.OUTPUT, "vtx_amp_vpd": FieldType.ADC, "vtx_amp_vref": FieldType.OUTPUT, @@ -146,7 +171,11 @@ class FieldType(Enum): [["joystick", "joystick_values"], [], []], [["five_way1", "five_way2", "five_way3"], [], []], [["misc_fan_pwm", "misc_fan_speeds"], [], []], - [["vbat", "vbat_offset", "vbat_scale"], [], []], + [["pwm_out_only"], ["pwm_outputs"], []], + [["vbat", "vbat_cal_min", "vbat_cal_max", "vbat_offset", "vbat_scale"], [], []], + [["vsrc1", "vsrc1_cal_min", "vsrc1_cal_max", "vsrc1_offset", "vsrc1_scale"], [], []], + [["vsrc2", "vsrc2_cal_min", "vsrc2_cal_max", "vsrc2_offset", "vsrc2_scale"], [], []], + [["vsrc3", "vsrc3_cal_min", "vsrc3_cal_max", "vsrc3_offset", "vsrc3_scale"], [], []], [["power_pdet", "power_pdet_intercept", "power_pdet_slope"], [], []], [["screen_sda"], ["screen_sck", "screen_type"], []], [["screen_cs", "screen_dc", "screen_mosi"], ["screen_type", "screen_sck", "screen_rst"], []], diff --git a/RX/DIY S3 DEVKIT 2400 True Diversity PWM 16.json b/RX/DIY S3 DEVKIT 2400 True Diversity PWM 16.json index b14ea7d..6e0518e 100644 --- a/RX/DIY S3 DEVKIT 2400 True Diversity PWM 16.json +++ b/RX/DIY S3 DEVKIT 2400 True Diversity PWM 16.json @@ -34,6 +34,8 @@ "vbat": 10, "vbat_offset": -197, "vbat_scale": 1200, + "vbat_cal_min": 3500, + "vbat_cal_max": 25200, "pwm_outputs":[2,9,11,12,13,14,21,35,36,37,38,39,40,41,42,47] } diff --git a/RX/DIY S3 DEVKIT 2400 True Diversity VTX PWM 11.json b/RX/DIY S3 DEVKIT 2400 True Diversity VTX PWM 11.json index 466c3ef..c00ad90 100644 --- a/RX/DIY S3 DEVKIT 2400 True Diversity VTX PWM 11.json +++ b/RX/DIY S3 DEVKIT 2400 True Diversity VTX PWM 11.json @@ -34,6 +34,8 @@ "vbat": 10, "vbat_offset": -197, "vbat_scale": 1200, + "vbat_cal_min": 3500, + "vbat_cal_max": 25200, "pwm_outputs":[2,9,11,12,13,14,21,35,36,37,38], diff --git a/RX/Frank 2400.json b/RX/Frank 2400.json index dcbabc0..12a4e02 100644 --- a/RX/Frank 2400.json +++ b/RX/Frank 2400.json @@ -36,5 +36,7 @@ "vbat_offset": 12, "vbat_scale": 410, "vbat_atten": 0, + "vbat_cal_min": 3500, + "vbat_cal_max": 25200, "button": 0 } diff --git a/RX/Generic 2400 PWMP5.json b/RX/Generic 2400 PWMP5.json index 6db382d..f0a2a56 100644 --- a/RX/Generic 2400 PWMP5.json +++ b/RX/Generic 2400 PWMP5.json @@ -17,5 +17,7 @@ "pwm_outputs": [0,1,3,9,10], "vbat": 17, "vbat_offset": 12, - "vbat_scale": 410 -} \ No newline at end of file + "vbat_scale": 410, + "vbat_cal_min": 3500, + "vbat_cal_max": 25200 +} diff --git a/RX/Generic 2400 PWMP6.json b/RX/Generic 2400 PWMP6.json index 0325924..6dcdfa3 100644 --- a/RX/Generic 2400 PWMP6.json +++ b/RX/Generic 2400 PWMP6.json @@ -16,5 +16,7 @@ "pwm_outputs": [0,1,3,9,10,5], "vbat": 17, "vbat_offset": 12, - "vbat_scale": 310 -} \ No newline at end of file + "vbat_scale": 310, + "vbat_cal_min": 4000, + "vbat_cal_max": 9000 +} diff --git a/RX/Generic 2400 PWMP7.json b/RX/Generic 2400 PWMP7.json index 146c6b3..12a5caa 100644 --- a/RX/Generic 2400 PWMP7.json +++ b/RX/Generic 2400 PWMP7.json @@ -15,5 +15,7 @@ "pwm_outputs": [0,1,3,9,10,5,2], "vbat": 17, "vbat_offset": 12, - "vbat_scale": 310 -} \ No newline at end of file + "vbat_scale": 310, + "vbat_cal_min": 3500, + "vbat_cal_max": 25200 +} diff --git a/RX/Generic 2400 True Diversity PA PWM 14.json b/RX/Generic 2400 True Diversity PA PWM 14.json index aacb662..68fbffe 100644 --- a/RX/Generic 2400 True Diversity PA PWM 14.json +++ b/RX/Generic 2400 True Diversity PA PWM 14.json @@ -33,5 +33,7 @@ "vbat": 36, "vbat_offset": -197, "vbat_scale": 1200, - "vbat_atten": 0 -} \ No newline at end of file + "vbat_atten": 0, + "vbat_cal_min": 3500, + "vbat_cal_max": 25200 +} diff --git a/RX/Generic 2400 True Diversity PWM 16.json b/RX/Generic 2400 True Diversity PWM 16.json index 0a55de2..6f4c316 100644 --- a/RX/Generic 2400 True Diversity PWM 16.json +++ b/RX/Generic 2400 True Diversity PWM 16.json @@ -30,5 +30,7 @@ "vbat": 36, "vbat_offset": -197, "vbat_scale": 1200, - "vbat_atten": 0 + "vbat_atten": 0, + "vbat_cal_min": 3500, + "vbat_cal_max": 25200 } diff --git a/RX/Generic 900 True Diversity PWM 16.json b/RX/Generic 900 True Diversity PWM 16.json index f204bdc..390e3ba 100644 --- a/RX/Generic 900 True Diversity PWM 16.json +++ b/RX/Generic 900 True Diversity PWM 16.json @@ -29,5 +29,7 @@ "vbat": 36, "vbat_offset": -197, "vbat_scale": 1200, - "vbat_atten": 0 + "vbat_atten": 0, + "vbat_cal_min": 3500, + "vbat_cal_max": 25200 } diff --git a/RX/Generic C3 2400 PWM.json b/RX/Generic C3 2400 PWM.json index 2454893..2d05734 100644 --- a/RX/Generic C3 2400 PWM.json +++ b/RX/Generic C3 2400 PWM.json @@ -17,6 +17,10 @@ "led_rgb": 8, "led_rgb_isgrb": true, "vbat": 0, - "vbat_offset": 12, - "vbat_scale": 410 -} \ No newline at end of file + "vbat_offset": 0, + "vbat_scale": 909, + "vbat_atten": 7, + "vbat_noreading": 13, + "vbat_cal_min": 3500, + "vbat_cal_max": 25200 +} diff --git a/RX/Generic C3 LR1121 PWM.json b/RX/Generic C3 LR1121 PWM.json index cdf5fc4..8fa43a5 100644 --- a/RX/Generic C3 LR1121 PWM.json +++ b/RX/Generic C3 LR1121 PWM.json @@ -18,7 +18,10 @@ "led_rgb": 8, "led_rgb_isgrb": true, "vbat": 0, - "vbat_offset": 3, - "vbat_scale": 937, - "vbat_atten": 7 + "vbat_offset": 0, + "vbat_scale": 909, + "vbat_atten": 7, + "vbat_noreading": 13, + "vbat_cal_min": 3500, + "vbat_cal_max": 25200 } diff --git a/RX/HelloRadio HR7E.json b/RX/HelloRadio HR7E.json index 7a9731a..4fdf988 100644 --- a/RX/HelloRadio HR7E.json +++ b/RX/HelloRadio HR7E.json @@ -34,6 +34,10 @@ "button": 0, "vbat": 36, - "vbat_offset": -147, - "vbat_scale": 1239 - } \ No newline at end of file + "vbat_offset": 19, + "vbat_scale": 990, + "vbat_atten": 7, + "vbat_noreading": 8, + "vbat_cal_min": 4000, + "vbat_cal_max": 30000 + } diff --git a/RX/HelloRadio HR8E.json b/RX/HelloRadio HR8E.json index 8fa6fa5..5f58927 100644 --- a/RX/HelloRadio HR8E.json +++ b/RX/HelloRadio HR8E.json @@ -34,6 +34,10 @@ "button": 0, "vbat": 36, - "vbat_offset": -147, - "vbat_scale": 1239 - } \ No newline at end of file + "vbat_offset": 19, + "vbat_scale": 990, + "vbat_atten": 7, + "vbat_noreading": 8, + "vbat_cal_min": 4000, + "vbat_cal_max": 30000 + } diff --git a/RX/Radiomaster 2400 ER8G.json b/RX/Radiomaster 2400 ER8G.json index 70e596e..a6b7f48 100644 --- a/RX/Radiomaster 2400 ER8G.json +++ b/RX/Radiomaster 2400 ER8G.json @@ -30,7 +30,10 @@ "i2c_scl": 18, "vbat": 39, "button": 0, - "vbat_scale": 700, - "vbat_offset": -30, - "vbat_atten": 7 + "vbat_scale": 987, + "vbat_offset": 3, + "vbat_atten": 7, + "vbat_noreading": -1, + "vbat_cal_min": 4000, + "vbat_cal_max": 30000 } diff --git a/RX/SPRacing RXG1 Gyro 2400 RX GYRO.json b/RX/SPRacing RXG1 Gyro 2400 RX GYRO.json index 285ef8d..4cec8a4 100644 --- a/RX/SPRacing RXG1 Gyro 2400 RX GYRO.json +++ b/RX/SPRacing RXG1 Gyro 2400 RX GYRO.json @@ -65,6 +65,8 @@ "vbat_atten": 7, "vbat_offset": -12, "vbat_scale": 902, + "vbat_cal_min": 4000, + "vbat_cal_max": 26000, "//": "LED", "led_rgb": 38, diff --git a/RX/SPRacing RXN1 Gyro 2400 RX GYRO IR D4.json b/RX/SPRacing RXN1 Gyro 2400 RX GYRO IR D4.json index 79289e7..a336dbf 100644 --- a/RX/SPRacing RXN1 Gyro 2400 RX GYRO IR D4.json +++ b/RX/SPRacing RXN1 Gyro 2400 RX GYRO IR D4.json @@ -71,6 +71,8 @@ "vbat_atten": 7, "vbat_offset": -12, "vbat_scale": 902, + "vbat_cal_min": 4000, + "vbat_cal_max": 26000, "//": "Analog IN", "//": "A1 - GPIO34/ADC1_CH6", "//": "A2 - GPIO35/ADC1_CH7", diff --git a/RX/Vario 2400.json b/RX/Vario 2400.json index e4b1cd5..d68de39 100644 --- a/RX/Vario 2400.json +++ b/RX/Vario 2400.json @@ -22,7 +22,10 @@ "pwm_outputs": [14,1,3,15,2,4], "vbat": 39, "button": 0, - "vbat_scale": 1024, - "vbat_offset": -62, - "vbat_atten": 7 -} \ No newline at end of file + "vbat_scale": 1007, + "vbat_offset": -32, + "vbat_atten": 7, + "vbat_noreading": -1, + "vbat_cal_min": 3000, + "vbat_cal_max": 26000 +} diff --git a/targets.json b/targets.json index 87a2768..0b8e2b5 100644 --- a/targets.json +++ b/targets.json @@ -125,11 +125,6 @@ "product_name": "BAYCKRC C3 2.4Ghz 6PWM 10mw RX", "lua_name": "BK 2G4 6PWM RX", "layout_file": "Generic C3 2400 PWM.json", - "overlay": { - "vbat_offset": 0, - "vbat_scale": 908, - "vbat_atten": 7 - }, "upload_methods": ["uart", "wifi", "betaflight"], "min_version": "3.5.0", "platform": "esp32-c3", @@ -390,9 +385,12 @@ "layout_file": "Generic 900 True Diversity PWM 16.json", "overlay": { "pwm_outputs":[13,15,2,0,4,9,10,5,18,23,19,22,3,1], - "vbat_offset": 18, - "vbat_scale": 1284, + "vbat_offset": 11, + "vbat_scale": 1289, "vbat_atten": 7, + "vbat_noreading": 8, + "vbat_cal_min": 3500, + "vbat_cal_max": 24000, "i2c_scl": 19, "i2c_sda": 22 }, @@ -518,6 +516,10 @@ "product_name": "BETAFPV PWM 2.4GHz RX", "lua_name": "BFPV PWM 2G4RX", "layout_file": "Generic 2400 PWMP5.json", + "overlay": { + "vbat_cal_min": 5000, + "vbat_cal_max": 9000 + }, "upload_methods": ["uart", "wifi", "betaflight"], "min_version": "3.0.0", "platform": "esp8285", @@ -543,9 +545,12 @@ "layout_file": "Generic 2400 True Diversity PA PWM 14.json", "overlay": { "radio_dcdc": true, - "vbat_offset": 18, - "vbat_scale": 1284, + "vbat_offset": 11, + "vbat_scale": 1289, "vbat_atten": 7, + "vbat_noreading": 8, + "vbat_cal_min": 3500, + "vbat_cal_max": 24000, "i2c_scl": 19, "i2c_sda": 22 }, @@ -2140,6 +2145,10 @@ "product_name": "HappyModel EPW5 2.4GHz PWM RX", "lua_name": "HM EPW5 2400", "layout_file": "Generic 2400 PWMP5.json", + "overlay": { + "vbat_cal_min": 5000, + "vbat_cal_max": 8400 + }, "upload_methods": ["uart", "wifi"], "min_version": "3.3.0", "platform": "esp8285", @@ -2150,6 +2159,10 @@ "product_name": "HappyModel EPW6 2.4GHz PWM RX", "lua_name": "HM EPW6 2400", "layout_file": "Generic 2400 PWMP6.json", + "overlay": { + "vbat_cal_min": 5000, + "vbat_cal_max": 8400 + }, "upload_methods": ["uart", "wifi"], "min_version": "3.3.0", "platform": "esp8285", @@ -2830,9 +2843,12 @@ "lua_name": "AION P6 2G4 RX", "layout_file": "Generic C3 2400 PWM.json", "overlay": { - "vbat_atten": 7, - "vbat_offset": 4, - "vbat_scale": 396 + "vbat_atten": 6, + "vbat_offset": 2, + "vbat_scale": 396, + "vbat_noreading": 15, + "vbat_cal_min": 3500, + "vbat_cal_max": 25200 }, "upload_methods": ["uart", "wifi", "betaflight"], "min_version": "3.5.0", @@ -2891,6 +2907,10 @@ "product_name": "MATEK R24-P PWM 2.4GHz RX", "lua_name": "MATEK R24-P", "layout_file": "Generic 2400 PWMP5.json", + "overlay": { + "vbat_cal_min": 4000, + "vbat_cal_max": 9000 + }, "upload_methods": ["uart", "wifi"], "min_version": "3.0.0", "platform": "esp8285", @@ -3321,8 +3341,11 @@ "layout_file": "Generic 2400 PWMP5.json", "overlay": { "pwm_outputs": [0,1,3], - "vbat_offset": -2, - "vbat_scale": 292 + "vbat_offset": -7, + "vbat_scale": 291, + "vbat_noreading": -1, + "vbat_cal_min": 4000, + "vbat_cal_max": 35000 }, "upload_methods": ["uart", "wifi"], "min_version": "3.1.0", @@ -3337,7 +3360,10 @@ "radio_dcdc": true, "pwm_outputs": [0,1,3,9], "vbat_offset": -10, - "vbat_scale": 292 + "vbat_scale": 289, + "vbat_noreading": -1, + "vbat_cal_min": 4000, + "vbat_cal_max": 35000 }, "upload_methods": ["uart", "wifi"], "min_version": "3.2.0", @@ -3349,6 +3375,10 @@ "product_name": "RadioMaster ER5A/C 2.4GHz PWM RX", "lua_name": "RM ER5A/C", "layout_file": "Generic 2400 PWMP5.json", + "overlay": { + "vbat_cal_min": 4500, + "vbat_cal_max": 8400 + }, "upload_methods": ["uart", "wifi"], "min_version": "3.1.0", "platform": "esp8285", @@ -3360,8 +3390,11 @@ "lua_name": "RM ER5C-i", "layout_file": "Generic 2400 PWMP5.json", "overlay": { - "vbat_offset": -2, - "vbat_scale": 292 + "vbat_offset": -7, + "vbat_scale": 291, + "vbat_noreading": -1, + "vbat_cal_min": 4000, + "vbat_cal_max": 35000 }, "upload_methods": ["uart", "wifi"], "min_version": "3.1.0", @@ -3373,8 +3406,11 @@ "lua_name": "RM ER5A/C V2", "layout_file": "Generic 2400 PWMP5.json", "overlay": { - "vbat_offset": -2, - "vbat_scale": 292 + "vbat_offset": -7, + "vbat_scale": 291, + "vbat_noreading": -1, + "vbat_cal_min": 4000, + "vbat_cal_max": 35000 }, "upload_methods": ["uart", "wifi"], "min_version": "3.1.0", @@ -3493,8 +3529,11 @@ "power_values": [-5,-4,-2,1], "power_lna_gain": 11, "vbat": 17, - "vbat_offset": -10, - "vbat_scale": 292 + "vbat_offset": -7, + "vbat_scale": 291, + "vbat_noreading": -1, + "vbat_cal_min": 4000, + "vbat_cal_max": 35000 }, "upload_methods": ["uart", "wifi", "betaflight"], "min_version": "3.0.0",