From fbdbe4fcbfee96feb412916e4f8ecd58aa497d6d Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Tue, 12 Apr 2022 19:22:43 +1000 Subject: [PATCH] Setup template --- source/Core/BSP/Magic/BSP.cpp | 4 ++-- source/Core/BSP/Magic/IRQ.cpp | 2 +- source/Core/BSP/Magic/Setup.cpp | 6 ++---- source/Core/BSP/Magic/configuration.h | 4 ++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/source/Core/BSP/Magic/BSP.cpp b/source/Core/BSP/Magic/BSP.cpp index 275d8788..eb24105c 100644 --- a/source/Core/BSP/Magic/BSP.cpp +++ b/source/Core/BSP/Magic/BSP.cpp @@ -14,7 +14,7 @@ const uint16_t powerPWM = 255; const uint8_t holdoffTicks = 10; const uint8_t tempMeasureTicks = 14; -uint16_t totalPWM; // Total length of the cycle's ticks +uint16_t totalPWM = 255; // Total length of the cycle's ticks void resetWatchdog() { //#TODO @@ -89,7 +89,7 @@ void reboot() { void delay_ms(uint16_t count) { // delay_1ms(count); - //#TODO + BL702_Delay_MS(count); } uint32_t __get_IPSR(void) { diff --git a/source/Core/BSP/Magic/IRQ.cpp b/source/Core/BSP/Magic/IRQ.cpp index 0fdc8acf..babdc6cd 100644 --- a/source/Core/BSP/Magic/IRQ.cpp +++ b/source/Core/BSP/Magic/IRQ.cpp @@ -27,7 +27,7 @@ void ADC0_1_IRQHandler(void) { // static void switchToFastPWM(void); // volatile uint16_t PWMSafetyTimer = 0; -// volatile uint8_t pendingPWM = 0; +volatile uint8_t pendingPWM = 200; // void TIMER1_IRQHandler(void) { // static bool lastPeriodWasFast = false; diff --git a/source/Core/BSP/Magic/Setup.cpp b/source/Core/BSP/Magic/Setup.cpp index 38c0ef61..c0aa6058 100644 --- a/source/Core/BSP/Magic/Setup.cpp +++ b/source/Core/BSP/Magic/Setup.cpp @@ -22,11 +22,9 @@ uint16_t ADCReadings[ADC_NORM_SAMPLES]; // room for 32 lots of the pair of readi // Functions void hardware_init() { - // #TODO gpio_set_mode(OLED_RESET_Pin, GPIO_OUTPUT_MODE); - gpio_set_mode(KEY_A_Pin, GPIO_INPUT_PD_MODE); - gpio_set_mode(KEY_B_Pin, GPIO_INPUT_PD_MODE); - I2C_SetPrd(I2C0_ID, 15); + // gpio_set_mode(KEY_A_Pin, GPIO_INPUT_PD_MODE); + // gpio_set_mode(KEY_B_Pin, GPIO_INPUT_PD_MODE); } uint16_t getADCHandleTemp(uint8_t sample) { diff --git a/source/Core/BSP/Magic/configuration.h b/source/Core/BSP/Magic/configuration.h index 2445c421..ebd386da 100644 --- a/source/Core/BSP/Magic/configuration.h +++ b/source/Core/BSP/Magic/configuration.h @@ -133,8 +133,8 @@ #define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C #define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F -#define POW_PD 1 -#define POW_QC 1 +#define POW_PD 0 +#define POW_QC 0 #define POW_DC 1 #define POW_QC_20V 1 #define ENABLE_QC2 1