From 651b61a854ef60a54c9cbcc39f6a467ef65749a5 Mon Sep 17 00:00:00 2001 From: Stephan Brunner Date: Tue, 4 Aug 2020 20:32:04 +0200 Subject: [PATCH] Add Makefile and do general cleanup --- .gitignore | 4 ++++ Makefile | 26 ++++++++++++++++++++++++++ os.c | 1 - os.h | 0 os_asm.s => os_asm.S | 0 5 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 Makefile mode change 100755 => 100644 os.c mode change 100755 => 100644 os.h rename os_asm.s => os_asm.S (100%) mode change 100755 => 100644 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..12d39a8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.o +*.elf +*.hex +*.bin diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c18b528 --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +CC = avr-gcc +CFLAGS = -Wall -Os -mmcu=atmega328p +OBJCOPY = avr-objcopy + +OBJ = main.o os.o os_asm.o + + +all: image.hex image.bin + +%.o: %.c + $(CC) $(CFLAGS) -c $< + +os_asm.o: os_asm.S + $(CC) $(CFLAGS) -c $< + +image.elf: $(OBJ) + $(CC) $(CFLAGS) -o image.elf $(OBJ) + +image.hex: image.elf + $(OBJCOPY) image.elf -O ihex image.hex + +image.bin: image.elf + $(OBJCOPY) image.elf -O binary image.bin + +clean: + rm -f *.o *.elf *.hex diff --git a/os.c b/os.c old mode 100755 new mode 100644 index 809d301..9cef1a4 --- a/os.c +++ b/os.c @@ -120,7 +120,6 @@ void* os_current_task_get_data(void) { } void os_current_task_kill(void) { - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { tasks[task_current_idx].valid = 0; } diff --git a/os.h b/os.h old mode 100755 new mode 100644 diff --git a/os_asm.s b/os_asm.S old mode 100755 new mode 100644 similarity index 100% rename from os_asm.s rename to os_asm.S