Skip to content

Commit

Permalink
Zipping compiler warning about POW_PD_EXT / Two options (#1711)
Browse files Browse the repository at this point in the history
* Zipping compiler warning about POW_PD_EXT / Option A

* Zipping compiler warning about POW_PD_EXT / Option B

* BSP/configuration.h: implement option A for POW_PD_EXT warning

---------

Co-authored-by: Ben V. Brown <[email protected]>
  • Loading branch information
ia and Ralim authored Jun 20, 2023
1 parent 55d4420 commit 155cf38
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 20 deletions.
3 changes: 2 additions & 1 deletion source/Core/BSP/MHP30/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@

#define PROFILE_SUPPORT

#define POW_PD 1
#define POW_PD 1
#define POW_PD_EXT 0
#define TEMP_NTC
#define I2C_SOFT_BUS_2
#define BATTFILTERDEPTH 8
Expand Down
30 changes: 14 additions & 16 deletions source/Core/BSP/Miniware/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
#define POWER_PULSE_DEFAULT 0
#else
#define POWER_PULSE_DEFAULT 5
#endif
#endif /* TS100 */
#define POWER_PULSE_WAIT_DEFAULT 4 // Default rate of the power pulse: 4*2500 = 10000 ms = 10 s
#define POWER_PULSE_DURATION_DEFAULT 1 // Default duration of the power pulse: 1*250 = 250 ms

Expand Down Expand Up @@ -126,6 +126,8 @@
#define ADC_MAX_READING (4096 * 8) // Maximum reading of the adc
#define ADC_VDD_MV 3300 // ADC max reading millivolts

#define POW_PD_EXT 0

// Deriving the Voltage div:
// Vin_max = (3.3*(r1+r2))/(r2)
// vdiv = (32768*4)/(vin_max*10)
Expand Down Expand Up @@ -172,7 +174,7 @@
#define POW_DC

#define TEMP_TMP36
#endif
#endif /* TS100 */

#ifdef MODEL_TS101
#define VOLTAGE_DIV 700 // 700 - Default divider from schematic
Expand Down Expand Up @@ -205,7 +207,7 @@
#define HAS_POWER_DEBUG_MENU
#define DEBUG_POWER_MENU_BUTTON_B

#endif
#endif /* TS101 */

#if defined(MODEL_TS80) + defined(MODEL_TS80P) > 0
#define MAX_POWER_LIMIT 40
Expand All @@ -219,7 +221,7 @@

#define LIS_ORI_FLIP
#define OLED_FLIP
#endif
#endif /* TS80(P) */

#ifdef MODEL_TS80
#define VOLTAGE_DIV 780 // Default divider from schematic
Expand All @@ -232,7 +234,7 @@
#define POW_QC

#define TEMP_TMP36
#endif
#endif /* TS80 */

#ifdef MODEL_TS80P
#define VOLTAGE_DIV 650 // Default for TS80P with slightly different resistors
Expand All @@ -247,18 +249,14 @@
#define TEMP_NTC
#define I2C_SOFT_BUS_2 1
#define SC7_ORI_FLIP
#endif
#endif

#ifdef MODEL_TS101
#define FLASH_LOGOADDR (0x08000000 + (126 * 1024))

#else
#define FLASH_LOGOADDR (0x08000000 + (62 * 1024))
#endif
#endif /* TS80P */

#ifdef MODEL_TS101
#define FLASH_LOGOADDR (0x08000000 + (126 * 1024))
#define SETTINGS_START_PAGE (0x08000000 + (127 * 1024))
#else
#define SETTINGS_START_PAGE (0x08000000 + (63 * 1024))
#endif
#define FLASH_LOGOADDR (0x08000000 + (62 * 1024))
#define SETTINGS_START_PAGE (0x08000000 + (63 * 1024))
#endif /* TS101 */

#endif /* CONFIGURATION_H_ */
1 change: 1 addition & 0 deletions source/Core/BSP/Pinecil/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F

#define POW_PD 1
#define POW_PD_EXT 0
#define POW_QC 1
#define POW_DC 1
#define POW_QC_20V 1
Expand Down
1 change: 1 addition & 0 deletions source/Core/BSP/Pinecilv2/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F
#define DEVICE_HAS_VALIDATION_CODE // We have 2 digit validations
#define POW_PD 1 // Supported features
#define POW_PD_EXT 0 // Future-proof macro for other models with other PD modes
#define POW_QC 1 // Supported features
#define POW_DC 1 // Supported features
#define POW_QC_20V 1 // Supported features
Expand Down
2 changes: 1 addition & 1 deletion source/Core/Drivers/HUB238.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,4 @@ uint8_t hub238_source_currentX100() {
}
return 10;//Failsafe to 0.1 amp
}
#endif
#endif
2 changes: 1 addition & 1 deletion source/Core/Drivers/HUB238.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ uint8_t hub238_source_currentX100();
uint16_t hub238_getVoltagePDOCurrent(uint8_t voltage);

#endif
#endif
#endif
2 changes: 1 addition & 1 deletion source/Core/Threads/OperatingModes/ShowStartupWarnings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ void showWarnings(void) {
}
#endif /*POW_PD_EXT==1*/
#endif /*NO_WARN_MISSING*/
}
}

0 comments on commit 155cf38

Please sign in to comment.