cleaned up unused functions and comments, added the main function from the low power code.

This commit is contained in:
jakeg00dwin 2024-07-27 11:55:30 -07:00
parent deba47b659
commit 1bf065d2c8
1 changed files with 14 additions and 15 deletions

View File

@ -9,10 +9,8 @@
* extracted into separate source files and headers for configuration. * extracted into separate source files and headers for configuration.
*/ */
//#define F_CPU 2000000UL
#define F_CPU 3333333UL #define F_CPU 3333333UL
//These defines are mostly useful for when you want you editors LSP server to //These defines are mostly useful for when you want you editors LSP server to
//function correctly. //function correctly.
//#ifndef __AVR_ATtiny404__ //#ifndef __AVR_ATtiny404__
@ -36,21 +34,9 @@
//Set the function pointer for the delay func //Set the function pointer for the delay func
void (*Delay_MicroSeconds)(double us) = _delay_us; void (*Delay_MicroSeconds)(double us) = _delay_us;
//void (*Delay_MicroSeconds)(double us) = _delay_ms;
/*
static void CLK_DisablePrescaler(void)
{
//CCP = CCP_IOREG_gc; //Write the needed signature to CCP
ccp_write_io((void *) & (CLKCTRL.MCLKCTRLA), 0x00); //select internal 20MHz clock.
ccp_write_io((void *) & (CLKCTRL.MCLKCTRLB), 0x00); //Disable the pre-scaler.
}
*/
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
//CLK_DisablePrescaler();
while(true){ while(true){
for(int i = 0; i < GatePulsesQty; i++){ for(int i = 0; i < GatePulsesQty; i++){
ZCD_Poll(); ZCD_Poll();
@ -59,6 +45,19 @@ int main(int argc, char **argv)
TriacOut_SetAllHigh(); TriacOut_SetAllHigh();
TriacOut_PulsePins(GatePulses[i]); TriacOut_PulsePins(GatePulses[i]);
} }
}
}
//The G1-G3 pins are low at this point.
_delay_ms(2500);
ZCD_Poll();
TriacOut_SetupPins();
TriacOut_SetAllHigh();
Load_HandleLoadPortA(ADC_LOAD1, 1);
Load_HandleLoadPortB(ADC_LOAD2, 3);
Load_HandleLoadPortB(ADC_LOAD3, 2);
while(true){
; //Do nothing until new Power cycle/reset occurs
}
}
}