main
*.o
build
+*.bin
.dep
# List all user libraries here\r
ULIBS =\r
\r
-#\r
# End of user defines\r
##############################################################################\r
\r
--- /dev/null
+CC = xtensa-lx106-elf-gcc
+CFLAGS = -DNODEMCU -I. -mlongcalls -Wall -Wextra -Werror -DDEBUG
+LDLIBS = -nostdlib -Wl,--start-group -lmain -lnet80211 -lwpa -llwip -lpp -lphy -lc -Wl,--end-group -lgcc -I/home/mrl/projects/esp-open-sdk/sdk/include -L/home/mrl/projects/esp-open-sdk/sdk/lib
+LDFLAGS = -Teagle.app.v6.ld
+
+OBJS:=interpret.o sds.o task.o main.o interface.o spec.o
+
+main-0x00000.bin: main
+ esptool.py elf2image $^
+
+main: $(OBJS)
+ $(CC) $(LDFLAGS) $(OBJS) $(LDLIBS) $(OUTPUT_OPTION)
+
+interface.o: interface_nodemcu.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+#FLASh: %-0x00000.bin
+# esptool.py write_flash 0 blinky-0x00000.bin 0x40000 blinky-0x40000.bin
+
+clean:
+ $(RM) main $(OBJS)
PROG:=main
OBJS:=interpret.o sds.o task.o main.o interface.o spec.o
-all: mTaskSymbols.h $(PROG)
+all: $(PROG)
interface.o: interface_linux.c
- $(CC) $(CFLAGS) -c $< -o $@
+ $(CC) $(CFLAGS) -c $< -o $@
$(PROG): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS)
-
-mTaskSymbols.h:
- CLMFLAGS=-nr make -BC ../.. mTaskInterpret
- ../../mTaskInterpret > $@
clean:
$(RM) $(OBJS) $(PROG)
#define HAVEAIO 1
#define HAVEDIO 1
+#elif defined NODEMCU
+#define MAXTASKS 5
+#define MAXSDSS 100
+#define HAVELED 0
+#define HAVEAIO 0
+#define HAVEDIO 0
+
#else
//Add you device here
#endif
--- /dev/null
+#include <stdbool.h>
+#include <stdint.h>
+
+bool input_available(void)
+{
+ return false;
+}
+
+uint8_t read_byte(void)
+{
+ return 0;
+}
+
+void write_byte(uint8_t b)
+{
+ (void)b;
+}
+
+long millis(void)
+{
+ return 0;
+}
+
+void delay(long ms)
+{
+ (void) ms;
+}
+
+void setup(void)
+{
+
+}
+
+void debug(char *fmt, ...)
+{
+ (void)fmt;
+}
+
+void pdie(char *s)
+{
+ (void)s;
+}
+
+void die(char *fmt, ...)
+{
+ (void)fmt;
+}
#include <stdlib.h>
#include <string.h>
-#ifdef STM
-#else
+#ifdef LINUX
#include <stdio.h>
+#elif defined NODEMCU
+#include "ets_sys.h"
+#include "osapi.h"
+#include "gpio.h"
+#include "os_type.h"
#endif
#include "interpret.h"
#ifdef STM
int main(void){
-#else
+#elif defined NODEMCU
+void ICACHE_FLASH_ATTR user_init(){
+#elif defined LINUX
int main(int argc, char *argv[]){
gargc = argc;
gargv = argv;
task_init();
debug("sending device spec");
while(true){
- //Check for newetasks
+ //Check for newtasks
loop();
delay(100);
}
+
+#ifndef NODEMCU
return 0;
+#endif
}