1
0
forked from me/IronOS

Setup template

This commit is contained in:
Ben V. Brown
2022-04-12 19:22:43 +10:00
parent 81a36eb2cf
commit fbdbe4fcbf
4 changed files with 7 additions and 9 deletions

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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