Patched function pointer from Low code base

This commit is contained in:
jakeg00dwin 2024-07-27 12:14:44 -07:00
parent a5b623d213
commit 321f5cd0f4
3 changed files with 4 additions and 25 deletions

View File

@ -8,15 +8,12 @@
#define __AVR_ATtiny404__ #define __AVR_ATtiny404__
#endif #endif
#include <avr/io.h> #include <avr/io.h>
#include "TriacOut.h" #include "TriacOut.h"
#include "RegEdit.h" #include "RegEdit.h"
void Delay_MicroSeconds_impl(double us);
void (*Delay_MicroSeconds)(double us) = &Delay_MicroSeconds_impl;
void TriacOut_InitTimerA(void) void TriacOut_InitTimerA(void)
{ {
@ -47,7 +44,3 @@ void TriacOut_PulsePins(uint16_t pulse_time)
RegEdit_ClearBit((void *) &PORTB.OUT, G2); RegEdit_ClearBit((void *) &PORTB.OUT, G2);
RegEdit_ClearBit((void *) &PORTB.OUT, G3); RegEdit_ClearBit((void *) &PORTB.OUT, G3);
} }
void Delay_MicroSeconds_impl(double us){
return;
}

View File

@ -12,13 +12,6 @@
//#define F_CPU 2000000UL //#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
//function correctly.
//#ifndef __AVR_ATtiny404__
//#define __AVR_ATtiny404__
//#endif
//This can prevent issues with utils/delay.h library with the gcc toolchain //This can prevent issues with utils/delay.h library with the gcc toolchain
#define __DELAY_BACKWARD_COMPATIBLE__ #define __DELAY_BACKWARD_COMPATIBLE__
@ -36,16 +29,6 @@
//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)

View File

@ -24,6 +24,9 @@ void FakeDelay(double us)
//do Nothing. //do Nothing.
} }
void (*Delay_MicroSeconds)(double us) = FakeDelay;
TEST_GROUP(test_TriacOut) TEST_GROUP(test_TriacOut)
{ {
void setup() void setup()