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