#------------------------------------------------- # Complement to Arduino.mk # Include this ADD-ON BEFORE Arduino.mk #------------------------------------------------- # RTOS install: use the feilipu/Arduino_FreeRTOS_Library # (rtos fork dedicated to arduino) # #------------------------------------------------- # (obsolete) # git clone https://github.com/feilipu/Arduino_FreeRTOS_Library.git # version 10.0.0-10, used in 2018 for testing # RTOS_TOP=/usr/local/tools/lustre/arduino/Arduino_FreeRTOS_Library/src # Current install # Still feilipu fork, became 'official' arhuino/freertos implem # can be download from arduino site # https://www.arduino.cc/reference/en/libraries/freertos/ ifndef RTOS_TOP $(error RTOS_TOP must point to a suitable FreeRTOS/src folder) endif # rtos sys tick is based on the Watchdog timer # define RTOS_TICK before including this makefile to change default 15ms # possible values are 15MS, 30MS, 60MS, 120MS, 250MS, 500MS, 1S, 2S OBJDIR=./objs ifndef RTOS_TICK RTOS_TICK=15MS endif RTOS_FLAGS=-DportUSE_WDTO=WDTO_${RTOS_TICK} #------------------------------------------------- # compilation, arduino rtos.a # These are all the .o files for rtos.a #------------------------------------------------- RTOS_OBJS=\ $(OBJDIR)/event_groups.o \ $(OBJDIR)/heap_3.o \ $(OBJDIR)/list.o \ $(OBJDIR)/port.o \ $(OBJDIR)/queue.o \ $(OBJDIR)/stream_buffer.o \ $(OBJDIR)/tasks.o \ $(OBJDIR)/timers.o \ $(OBJDIR)/variantHooks.o # $(OBJDIR)/croutine.o \ # Sources are either .c or .cpp, in RTOS_TOP $(OBJDIR)/%.o: $(RTOS_TOP)/%.c $(CC) $(CC_FLAGS) $(RTOS_FLAGS) $(INCLS) $< -o $@ $(OBJDIR)/%.o: $(RTOS_TOP)/%.cpp $(CPP) $(CPP_FLAGS) $(RTOS_FLAGS) $(INCLS) $< -o $@ # build the library $(OBJDIR)/rtos.a: $(RTOS_OBJS) $(AR) rcs $@ $(RTOS_OBJS) USR_LIBS+=$(OBJDIR)/rtos.a USR_INCLS+=-I$(RTOS_TOP)