diff options
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | main.c | 5 | ||||
-rw-r--r-- | main.h | 2 | ||||
-rw-r--r-- | master_clock_addon.sch | bin | 0 -> 94954 bytes | |||
-rw-r--r-- | master_clock_tn26.brd | bin | 0 -> 33895 bytes | |||
-rw-r--r-- | master_clock_tn26.sch | bin | 0 -> 287827 bytes | |||
-rw-r--r-- | timebase.c | 8 |
7 files changed, 12 insertions, 10 deletions
@@ -1,7 +1,7 @@ .PHONY: love flash love: sublab77.ihex -CFLAGS=-Wall -Wextra -pedantic -std=c99 -Os -DF_CPU=1000000 -mmcu=attiny26 +CFLAGS=-Wall -Wextra -pedantic -std=c99 -DF_CPU=1000000UL -Os -fshort-enums -fno-move-loop-invariants -fno-tree-loop-optimize -mmcu=attiny26 %.o: %.c avr-gcc $(CFLAGS) -c -o $@ $< @@ -16,4 +16,7 @@ sublab77.elf: clock.o dcf77.o lcd.o main.o timebase.o endif sublab77.ihex: sublab77.elf - objcopy -Oihex $^ $@ + avr-objcopy -Oihex $^ $@ + +clean: + rm *.o *.elf *.ihex @@ -186,7 +186,7 @@ static void perform(void) extern void __vectors(void) __attribute__((noreturn));
__attribute__ ((noreturn))
-SIGNAL (ANA_COMP_vect)
+ISR (ANA_COMP_vect)
{
PORTA = 0xff;
@@ -200,7 +200,8 @@ SIGNAL (ANA_COMP_vect) __vectors();
}
-int main( void )
+int __attribute__((OS_main)) +main( void )
{
PORTA = 0xFF; // enable pull ups
@@ -2,8 +2,6 @@ #include <avr/interrupt.h>
#include "types.h"
-#define XTAL 1000000L
-
// Hardware Definitions
diff --git a/master_clock_addon.sch b/master_clock_addon.sch Binary files differnew file mode 100644 index 0000000..b8f1f3a --- /dev/null +++ b/master_clock_addon.sch diff --git a/master_clock_tn26.brd b/master_clock_tn26.brd Binary files differnew file mode 100644 index 0000000..4381f1e --- /dev/null +++ b/master_clock_tn26.brd diff --git a/master_clock_tn26.sch b/master_clock_tn26.sch Binary files differnew file mode 100644 index 0000000..a992b7b --- /dev/null +++ b/master_clock_tn26.sch @@ -2,10 +2,10 @@ #include "timebase.h"
// at 12MHz:
-#define T0COUNT (XTAL / 1024 / 64) // 183
-#define T0SECERR (XTAL - 1024L * 64 * T0COUNT) // 6912
+#define T0COUNT (F_CPU / 1024 / 64) // 183
+#define T0SECERR (F_CPU - 1024L * 64 * T0COUNT) // 6912
#define T0COUNTSEC (T0COUNT + T0SECERR / 1024) // 189
-#define T0MINERR (XTAL - 1024 * (63 * T0COUNT + T0COUNTSEC)) // 768
+#define T0MINERR (F_CPU - 1024 * (63 * T0COUNT + T0COUNTSEC)) // 768
#define T0COUNTMIN (T0COUNTSEC + (T0MINERR * 60 + 512) / 1024) // 234
// 234 = 12000000 Hz
@@ -26,7 +26,7 @@ void timebase_init( void ) extern uint8_t waitctr;
-SIGNAL (TIMER0_OVF0_vect)
+ISR (TIMER0_OVF0_vect)
{
static u8 dcf77_time, old_dcf77;
// DCF77 receive
|