Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zipping compiler warning about POW_PD_EXT / Two options #1711

Merged
merged 6 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Copy link
Collaborator Author

@ia ia Jun 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't you find this way more readable? If no, I will revert it without a question.

Here it doesn't show the idea of modification properly - just in case, for easier review that's what I did. What do you think?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is a fine cleanup

#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_ */
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may not understanding some particularities so correct me if I'm wrong but shouldn't endif for include-guard be in the very end of the file, right?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah thats a mistake

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*/
}
}