refactored out funciton pointer for both platforms

This commit is contained in:
jakeg00dwin 2024-07-27 12:09:29 -07:00
parent 6a50bf61b5
commit e966625043
4 changed files with 5 additions and 9 deletions

1
.gitignore vendored
View File

@ -102,3 +102,4 @@ _deps
.cache/clangd/index .cache/clangd/index
build/tests build/tests
.generated_files/flags/attiny404 .generated_files/flags/attiny404
dist/attiny404/production

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

@ -31,7 +31,6 @@
#include <util/delay.h> #include <util/delay.h>
//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;

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()