├── .cproject ├── .gitignore ├── .project ├── .settings ├── language.settings.xml ├── org.eclipse.cdt.codan.core.prefs ├── org.eclipse.cdt.core.prefs └── org.eclipse.ltk.core.refactoring.prefs ├── BUILD ├── Documents ├── .gitignore ├── CHANGES TO ORIGINAL WHITECAT.pdf ├── Hardware │ ├── Cameras │ │ ├── ArduCAM_Mini_2MP_Camera_Shield_DS.pdf │ │ └── ArduCAM_Mini_2MP_Camera_Shield_Hardware_Application_Note.pdf │ ├── Displays │ │ ├── ILI9341.pdf │ │ ├── ST7789S.pdf │ │ └── XPT2046.pdf │ ├── IO │ │ ├── MCP3004_3008.pdf │ │ ├── MCP3204_3208.pdf │ │ └── PCF8574.pdf │ ├── Protocols │ │ └── I2C-bus and how to use it.pdf │ └── Sensors │ │ ├── BME280 DataSheet.pdf │ │ ├── DHT22.pdf │ │ ├── DS1822.pdf │ │ ├── DS18B20.pdf │ │ ├── DS18S20.pdf │ │ ├── DS28EA00.pdf │ │ └── dht11.pdf ├── LCD Module.pdf └── Lua CJSON 2.1.0 Manual.pdf ├── FLASH_REG_PROG.sh ├── GDB ├── Makefile ├── README.md ├── bin ├── bootloader.bin ├── lua_rtos.bin ├── partitions_singleapp.bin └── read.me ├── components ├── http │ ├── component.mk │ ├── httpclient.c │ ├── httpclient.h │ └── httpsrv.c ├── lua_rtos │ ├── Kconfig │ ├── Lua │ │ ├── adds │ │ │ ├── lrodefs.h │ │ │ ├── lrotable.h │ │ │ ├── luaconf.h │ │ │ └── modules.h │ │ ├── common │ │ │ ├── cache.c │ │ │ ├── cache.h │ │ │ ├── fpconv.c │ │ │ ├── fpconv.h │ │ │ ├── lex.yy.c │ │ │ ├── linenoise.c │ │ │ ├── linenoise.h │ │ │ ├── lrotable.c │ │ │ ├── shell.l │ │ │ ├── shell.y │ │ │ ├── strbuf.c │ │ │ ├── strbuf.h │ │ │ ├── tjpgd.c │ │ │ ├── tjpgd.h │ │ │ ├── y.tab.c │ │ │ ├── y.tab.h │ │ │ ├── ymodem.c │ │ │ └── ymodem.h │ │ ├── modules │ │ │ ├── adc.c │ │ │ ├── adc.h │ │ │ ├── auxmods.h │ │ │ ├── cam.c │ │ │ ├── can.c │ │ │ ├── error.c │ │ │ ├── error.h │ │ │ ├── event.c │ │ │ ├── event.h │ │ │ ├── gps.c │ │ │ ├── http.c │ │ │ ├── i2c.c │ │ │ ├── i2c.h │ │ │ ├── lbaselib_adds.inc │ │ │ ├── led.c │ │ │ ├── liolib_adds.inc │ │ │ ├── lora.c │ │ │ ├── loslib_adds.inc │ │ │ ├── lpack.c │ │ │ ├── lua_adds.inc │ │ │ ├── lua_cjson.c │ │ │ ├── mqtt.c │ │ │ ├── neopixel.c │ │ │ ├── neopixel.h │ │ │ ├── net.c │ │ │ ├── net.h │ │ │ ├── net_service_http.inc │ │ │ ├── net_service_sntp.inc │ │ │ ├── net_wifi.inc │ │ │ ├── nvs.c │ │ │ ├── pio.c │ │ │ ├── pio.h │ │ │ ├── pwm.c │ │ │ ├── pwm.h │ │ │ ├── screen │ │ │ │ ├── DefaultFont.c │ │ │ │ ├── DejaVuSans18.c │ │ │ │ ├── DejaVuSans24.c │ │ │ │ ├── Ubuntu16.c │ │ │ │ ├── comic24.c │ │ │ │ ├── minya24.c │ │ │ │ ├── tft.c │ │ │ │ ├── tftspi.c │ │ │ │ ├── tftspi.h │ │ │ │ └── tooney32.c │ │ │ ├── sensor.c │ │ │ ├── sensor.h │ │ │ ├── servo.c │ │ │ ├── servo.h │ │ │ ├── spi.c │ │ │ ├── spi.h │ │ │ ├── stepper.c │ │ │ ├── thread.c │ │ │ ├── thread.h │ │ │ ├── tmr.c │ │ │ ├── uart.c │ │ │ ├── uart.h │ │ │ └── untitled.txt │ │ └── src │ │ │ ├── lapi.c │ │ │ ├── lapi.h │ │ │ ├── lauxlib.c │ │ │ ├── lauxlib.h │ │ │ ├── lbaselib.c │ │ │ ├── lbitlib.c │ │ │ ├── lcode.c │ │ │ ├── lcode.h │ │ │ ├── lcorolib.c │ │ │ ├── lctype.c │ │ │ ├── lctype.h │ │ │ ├── ldblib.c │ │ │ ├── ldebug.c │ │ │ ├── ldebug.h │ │ │ ├── ldo.c │ │ │ ├── ldo.h │ │ │ ├── ldump.c │ │ │ ├── lfunc.c │ │ │ ├── lfunc.h │ │ │ ├── lgc.c │ │ │ ├── lgc.h │ │ │ ├── linit.c │ │ │ ├── liolib.c │ │ │ ├── llex.c │ │ │ ├── llex.h │ │ │ ├── llimits.h │ │ │ ├── lmathlib.c │ │ │ ├── lmem.c │ │ │ ├── lmem.h │ │ │ ├── loadlib.c │ │ │ ├── lobject.c │ │ │ ├── lobject.h │ │ │ ├── lopcodes.c │ │ │ ├── lopcodes.h │ │ │ ├── loslib.c │ │ │ ├── lparser.c │ │ │ ├── lparser.h │ │ │ ├── lprefix.h │ │ │ ├── lstate.c │ │ │ ├── lstate.h │ │ │ ├── lstring.c │ │ │ ├── lstring.h │ │ │ ├── lstrlib.c │ │ │ ├── ltable.c │ │ │ ├── ltable.h │ │ │ ├── ltablib.c │ │ │ ├── ltm.c │ │ │ ├── ltm.h │ │ │ ├── lua.c │ │ │ ├── lua.h │ │ │ ├── lua.hpp │ │ │ ├── luac.c │ │ │ ├── luaconf.h │ │ │ ├── lualib.h │ │ │ ├── lundump.c │ │ │ ├── lundump.h │ │ │ ├── lutf8lib.c │ │ │ ├── lvm.c │ │ │ ├── lvm.h │ │ │ ├── lzio.c │ │ │ └── lzio.h │ ├── Makefile.projbuild │ ├── component.mk │ ├── drivers │ │ ├── adc.c │ │ ├── adc.h │ │ ├── adc_internal.c │ │ ├── adc_internal.h │ │ ├── adc_mcp3008.c │ │ ├── adc_mcp3008.h │ │ ├── adc_mcp3208.c │ │ ├── adc_mcp3208.h │ │ ├── arducam.c │ │ ├── arducam.h │ │ ├── clock.c │ │ ├── cpu.c │ │ ├── cpu.h │ │ ├── espi.c │ │ ├── espi.h │ │ ├── gpio.c │ │ ├── gpio.h │ │ ├── i2c.c │ │ ├── i2c.h │ │ ├── lmic_hal.c │ │ ├── lora.h │ │ ├── lora_lmic.c │ │ ├── neopixel.c │ │ ├── neopixel.h │ │ ├── net.c │ │ ├── net.h │ │ ├── nzr.c │ │ ├── nzr.h │ │ ├── owire.c │ │ ├── owire.h │ │ ├── power_bus.c │ │ ├── power_bus.h │ │ ├── pwm.c │ │ ├── pwm.h │ │ ├── sd.c │ │ ├── sd.h │ │ ├── sensor.c │ │ ├── sensor.h │ │ ├── servo.c │ │ ├── servo.h │ │ ├── spi.c │ │ ├── spi.h │ │ ├── stepper.c │ │ ├── stepper.h │ │ ├── uart.c │ │ ├── uart.h │ │ ├── wifi.c │ │ ├── wifi.h │ │ ├── ws2812.c │ │ └── ws2812.h │ ├── editor │ │ └── edit.c │ ├── freertos │ │ ├── adds.c │ │ └── adds.h │ ├── ld │ │ └── lua_rtos.ld │ ├── lmic │ │ ├── aes.c │ │ ├── hal.h │ │ ├── lmic.c │ │ ├── lmic.h │ │ ├── lorabase.h │ │ ├── oslmic.c │ │ ├── oslmic.h │ │ └── radio.c │ ├── luartos │ ├── luartos.h │ ├── lwip │ │ ├── component.mk │ │ ├── ping.c │ │ ├── ping.h │ │ └── socket.c │ ├── math │ │ ├── e_remainder.c │ │ ├── ef_remainder.c │ │ └── fdlibm.h │ ├── pthread │ │ ├── attr.c │ │ ├── cleanup.c │ │ ├── component.mk │ │ ├── cond.c │ │ ├── create.c │ │ ├── join.c │ │ ├── key.c │ │ ├── mutex.c │ │ ├── once.c │ │ ├── pthread.c │ │ ├── pthread.h │ │ └── self.c │ ├── sensors │ │ ├── 2y0a21.c │ │ ├── 2y0a21.h │ │ ├── bme280.c │ │ ├── bme280.h │ │ ├── dht11.c │ │ ├── dht11.h │ │ ├── ds1820.c │ │ ├── ds1820.h │ │ ├── ping28015.c │ │ ├── ping28015.h │ │ ├── tmp36.c │ │ └── tmp36.h │ ├── sys │ │ ├── build.h │ │ ├── console.c │ │ ├── console.h │ │ ├── debug.c │ │ ├── debug.h │ │ ├── delay.c │ │ ├── delay.h │ │ ├── device.h │ │ ├── disklabel.h │ │ ├── driver.c │ │ ├── driver.h │ │ ├── list.c │ │ ├── list.h │ │ ├── mount.c │ │ ├── mount.h │ │ ├── mutex.c │ │ ├── mutex.h │ │ ├── panic.c │ │ ├── panic.h │ │ ├── preprocessor.h │ │ ├── semaphore.h │ │ ├── signal.c │ │ ├── sleep.c │ │ ├── sleep.h │ │ ├── status.c │ │ ├── status.h │ │ ├── sys_init.c │ │ └── syslog.h │ ├── syscalls │ │ ├── __wrap__calloc_r.c │ │ ├── __wrap__malloc_r.c │ │ ├── __wrap__open_r.c │ │ ├── __wrap__realloc_r.c │ │ ├── __wrap__rename_r.c │ │ ├── __wrap__stat_r.c │ │ ├── __wrap__unlink_r.c │ │ ├── __wrap_mkdir.c │ │ ├── __wrap_opendir.c │ │ ├── __wrap_readdir.c │ │ └── chdir.c │ ├── unix │ │ ├── getcwd.c │ │ └── syslog.c │ └── vfs │ │ ├── fat.c │ │ ├── fat.h │ │ ├── net.c │ │ ├── spiffs.c │ │ ├── tty.c │ │ └── vfs.h ├── mkspiffs │ ├── .travis.yml │ ├── Makefile.projbuild │ └── src │ │ ├── Makefile │ │ ├── Makefile.original │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── main.cpp │ │ ├── spiffs │ │ ├── esp_spiffs.c │ │ ├── esp_spiffs.h │ │ ├── spiffs.h │ │ ├── spiffs_cache.c │ │ ├── spiffs_check.c │ │ ├── spiffs_config.h │ │ ├── spiffs_gc.c │ │ ├── spiffs_hydrogen.c │ │ ├── spiffs_nucleus.c │ │ └── spiffs_nucleus.h │ │ └── tclap │ │ ├── Arg.h │ │ ├── ArgException.h │ │ ├── ArgTraits.h │ │ ├── COPYING │ │ ├── CmdLine.h │ │ ├── CmdLineInterface.h │ │ ├── CmdLineOutput.h │ │ ├── Constraint.h │ │ ├── DocBookOutput.h │ │ ├── HelpVisitor.h │ │ ├── IgnoreRestVisitor.h │ │ ├── MultiArg.h │ │ ├── MultiSwitchArg.h │ │ ├── OptionalUnlabeledTracker.h │ │ ├── StandardTraits.h │ │ ├── StdOutput.h │ │ ├── SwitchArg.h │ │ ├── UnlabeledMultiArg.h │ │ ├── UnlabeledValueArg.h │ │ ├── ValueArg.h │ │ ├── ValuesConstraint.h │ │ ├── VersionVisitor.h │ │ ├── Visitor.h │ │ ├── XorHandler.h │ │ └── ZshCompletionOutput.h ├── mqtt │ ├── Clients.c │ ├── Clients.h │ ├── Heap.h │ ├── LinkedList.c │ ├── LinkedList.h │ ├── Log.h │ ├── MQTTClient.c │ ├── MQTTClient.h │ ├── MQTTClientPersistence.h │ ├── MQTTPacket.c │ ├── MQTTPacket.h │ ├── MQTTPacketOut.c │ ├── MQTTPacketOut.h │ ├── MQTTProtocol.h │ ├── MQTTProtocolClient.c │ ├── MQTTProtocolClient.h │ ├── MQTTProtocolOut.c │ ├── MQTTProtocolOut.h │ ├── Makefile.projbuild │ ├── Messages.c │ ├── Messages.h │ ├── SSLSocket.c │ ├── SSLSocket.h │ ├── Socket.c │ ├── Socket.h │ ├── SocketBuffer.c │ ├── SocketBuffer.h │ ├── StackTrace.h │ ├── Thread.c │ ├── Thread.h │ ├── component.mk │ ├── memory.h │ ├── utf-8.c │ └── utf-8.h ├── spiffs │ ├── component.mk │ ├── esp_spiffs.c │ ├── esp_spiffs.h │ ├── spiffs.h │ ├── spiffs_cache.c │ ├── spiffs_check.c │ ├── spiffs_config.h │ ├── spiffs_gc.c │ ├── spiffs_hydrogen.c │ ├── spiffs_nucleus.c │ └── spiffs_nucleus.h ├── spiffs_image │ ├── Makefile.projbuild │ └── image │ │ ├── @font │ │ ├── BigFont.c │ │ ├── BigFont.fon │ │ ├── DejaVuSans12.c │ │ ├── DejaVuSans12.fon │ │ ├── DejaVuSans18.c │ │ ├── DejaVuSans18.fon │ │ ├── DejaVuSans24.c │ │ ├── DejaVuSans24.fon │ │ ├── DotMatrix_M.c │ │ ├── DotMatrix_M.fon │ │ ├── Grotesk24x48.c │ │ ├── Grotesk24x48.fon │ │ ├── OCR_A_Extended_M.c │ │ ├── SmallFont.c │ │ ├── SmallFont.fon │ │ ├── Ubuntu.c │ │ ├── Ubuntu.fon │ │ ├── arial_bold.c │ │ ├── arial_bold.fon │ │ ├── swiss721_outline.c │ │ └── swiss721_outline.fon │ │ ├── autorun.lua │ │ ├── examples │ │ └── lua │ │ │ ├── abp.lua │ │ │ ├── adc-tmp36.lua │ │ │ ├── blink.lua │ │ │ ├── i2c.lua │ │ │ ├── lora.lua │ │ │ ├── mqtt.lua │ │ │ ├── neopixel.lua │ │ │ ├── pwm.lua │ │ │ ├── stepper.lua │ │ │ ├── tft │ │ │ ├── paint.lua │ │ │ ├── tftdemo.lua │ │ │ └── tpcalib.lua │ │ │ └── wifi.lua │ │ ├── images │ │ ├── nature_160x123.img │ │ ├── newyear_128x96.img │ │ ├── tiger.bmp │ │ └── tiger240.jpg │ │ ├── sys │ │ └── zoneinfo │ │ │ ├── GB │ │ │ ├── GMT │ │ │ ├── Madrid │ │ │ ├── UTC │ │ │ ├── localtime │ │ │ └── posixrules │ │ ├── system.lua │ │ └── tests │ │ ├── all.lua │ │ ├── api.lua │ │ ├── attrib.lua │ │ ├── big.lua │ │ ├── bitwise.lua │ │ ├── calls.lua │ │ ├── closure.lua │ │ ├── code.lua │ │ ├── constructs.lua │ │ ├── coroutine.lua │ │ ├── db.lua │ │ ├── errors.lua │ │ ├── events.lua │ │ ├── files.lua │ │ ├── gc.lua │ │ ├── goto.lua │ │ ├── libs │ │ ├── lib1.c │ │ ├── lib11.c │ │ ├── lib2.c │ │ ├── lib21.c │ │ └── makefile │ │ ├── literals.lua │ │ ├── locals.lua │ │ ├── ltests │ │ ├── ltests.c │ │ └── ltests.h │ │ ├── main.lua │ │ ├── math.lua │ │ ├── nextvar.lua │ │ ├── pm.lua │ │ ├── sort.lua │ │ ├── strings.lua │ │ ├── test.lua │ │ ├── tpack.lua │ │ ├── utf8.lua │ │ ├── vararg.lua │ │ └── verybig.lua ├── unity │ ├── component.mk │ ├── include │ │ ├── unity.h │ │ ├── unity_config.h │ │ └── unity_internals.h │ ├── license.txt │ ├── unity.c │ └── unity_platform.c └── zlib │ ├── adler32.c │ ├── component.mk │ ├── compress.c │ ├── crc32.c │ ├── crc32.h │ ├── deflate.c │ ├── deflate.h │ ├── gzclose.c │ ├── gzguts.h │ ├── gzlib.c │ ├── gzread.c │ ├── gzwrite.c │ ├── infback.c │ ├── inffast.c │ ├── inffast.h │ ├── inffixed.h │ ├── inflate.c │ ├── inflate.h │ ├── inftrees.c │ ├── inftrees.h │ ├── trees.c │ ├── trees.h │ ├── uncompr.c │ ├── zconf.h │ ├── zlib.h │ ├── zutil.c │ └── zutil.h ├── examples ├── @font │ ├── BigFont.c │ ├── BigFont.fon │ ├── DejaVuSans12.c │ ├── DejaVuSans12.fon │ ├── DejaVuSans18.c │ ├── DejaVuSans18.fon │ ├── DejaVuSans24.c │ ├── DejaVuSans24.fon │ ├── DotMatrix_M.c │ ├── DotMatrix_M.fon │ ├── Grotesk24x48.c │ ├── Grotesk24x48.fon │ ├── OCR_A_Extended_M.c │ ├── SmallFont.c │ ├── SmallFont.fon │ ├── Ubuntu.c │ ├── Ubuntu.fon │ ├── arial_bold.c │ ├── arial_bold.fon │ ├── swiss721_outline.c │ └── swiss721_outline.fon ├── nature.bmp ├── nature_160x123.img ├── newyear_128x96.img ├── paint.lua ├── tftdemo.lua ├── tiger.bmp ├── tiger240.jpg └── tpcalib.lua ├── main ├── .settings │ ├── language.settings.xml │ └── org.eclipse.cdt.core.prefs ├── component.mk ├── lua_rtos_main.c ├── patches │ ├── api_msg.patch │ ├── ccsbcs.c │ ├── ffconf.h │ ├── free_rtos_config.patch │ ├── spi_flash.1.patch │ └── spi_flash.2.patch └── test │ └── lua_rtos │ ├── component.mk │ └── test │ ├── component.mk │ ├── i2c.c │ └── pthread-cond.c ├── sdkconfig ├── sdkconfig.old └── tools └── font ├── msvcp71.dll ├── msvcr71.dll └── ttf2c_vc2003.exe /.gitignore: -------------------------------------------------------------------------------- 1 | .config 2 | *.o 3 | *.pyc 4 | *.a 5 | *.d 6 | 7 | # gtags 8 | GTAGS 9 | GRTAGS 10 | GPATH 11 | 12 | # emacs 13 | .dir-locals.el 14 | 15 | # emacs temp file suffixes 16 | *~ 17 | .#* 18 | \#*# 19 | 20 | build/ 21 | temp/ 22 | *.dis 23 | *.elf 24 | *.map 25 | **/.DS_Store 26 | components/mkspiffs/src/mkspiffs 27 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Lua-RTOS 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | 14 | 15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 16 | full,incremental, 17 | 18 | 19 | 20 | 21 | 22 | org.eclipse.cdt.core.cnature 23 | org.eclipse.cdt.core.ccnature 24 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 25 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 26 | 27 | 28 | -------------------------------------------------------------------------------- /.settings/language.settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.settings/org.eclipse.ltk.core.refactoring.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false 3 | -------------------------------------------------------------------------------- /BUILD: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export HOST_PLATFORM=linux 3 | export PATH=$PATH:/home/LoBo2_Razno/ESP32/xtensa-esp32-elf/bin 4 | export IDF_PATH=/home/LoBo2_Razno/ESP32/esp-idf 5 | 6 | make "$@" 7 | -------------------------------------------------------------------------------- /Documents/.gitignore: -------------------------------------------------------------------------------- 1 | /*.wps 2 | /*.odt 3 | /*.docx 4 | -------------------------------------------------------------------------------- /Documents/CHANGES TO ORIGINAL WHITECAT.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/CHANGES TO ORIGINAL WHITECAT.pdf -------------------------------------------------------------------------------- /Documents/Hardware/Cameras/ArduCAM_Mini_2MP_Camera_Shield_DS.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/Hardware/Cameras/ArduCAM_Mini_2MP_Camera_Shield_DS.pdf -------------------------------------------------------------------------------- /Documents/Hardware/Cameras/ArduCAM_Mini_2MP_Camera_Shield_Hardware_Application_Note.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/Hardware/Cameras/ArduCAM_Mini_2MP_Camera_Shield_Hardware_Application_Note.pdf -------------------------------------------------------------------------------- /Documents/Hardware/Displays/ILI9341.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/Hardware/Displays/ILI9341.pdf -------------------------------------------------------------------------------- /Documents/Hardware/Displays/ST7789S.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/Hardware/Displays/ST7789S.pdf -------------------------------------------------------------------------------- /Documents/Hardware/Displays/XPT2046.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/Hardware/Displays/XPT2046.pdf -------------------------------------------------------------------------------- /Documents/Hardware/IO/MCP3004_3008.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/Hardware/IO/MCP3004_3008.pdf -------------------------------------------------------------------------------- /Documents/Hardware/IO/MCP3204_3208.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/Hardware/IO/MCP3204_3208.pdf -------------------------------------------------------------------------------- /Documents/Hardware/IO/PCF8574.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/Hardware/IO/PCF8574.pdf -------------------------------------------------------------------------------- /Documents/Hardware/Protocols/I2C-bus and how to use it.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/Hardware/Protocols/I2C-bus and how to use it.pdf -------------------------------------------------------------------------------- /Documents/Hardware/Sensors/BME280 DataSheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/Hardware/Sensors/BME280 DataSheet.pdf -------------------------------------------------------------------------------- /Documents/Hardware/Sensors/DHT22.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/Hardware/Sensors/DHT22.pdf -------------------------------------------------------------------------------- /Documents/Hardware/Sensors/DS1822.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/Hardware/Sensors/DS1822.pdf -------------------------------------------------------------------------------- /Documents/Hardware/Sensors/DS18B20.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/Hardware/Sensors/DS18B20.pdf -------------------------------------------------------------------------------- /Documents/Hardware/Sensors/DS18S20.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/Hardware/Sensors/DS18S20.pdf -------------------------------------------------------------------------------- /Documents/Hardware/Sensors/DS28EA00.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/Hardware/Sensors/DS28EA00.pdf -------------------------------------------------------------------------------- /Documents/Hardware/Sensors/dht11.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/Hardware/Sensors/dht11.pdf -------------------------------------------------------------------------------- /Documents/LCD Module.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/LCD Module.pdf -------------------------------------------------------------------------------- /Documents/Lua CJSON 2.1.0 Manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/Documents/Lua CJSON 2.1.0 Manual.pdf -------------------------------------------------------------------------------- /FLASH_REG_PROG.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export HOST_PLATFORM=linux 3 | export PATH=$PATH:/home/LoBo2_Razno/ESP32/xtensa-esp32-elf/bin 4 | export IDF_PATH=/home/LoBo2_Razno/ESP32/esp-idf 5 | 6 | 7 | # For boards which don't use the internal regulator, GPIO12 can be pulled high. 8 | # On boards which use the internal regulator and a 3.3V flash chip, GPIO12 should be pulled up high, which is compatible with SD card operation. 9 | # For boards which use 3.3V flash chip, GPIO12 needs to be low at reset. 10 | # * In this case, internal pullup can be enabled using a `gpio_pullup_en(GPIO_NUM_12);` call. Most SD cards work fine when an internal pullup on GPIO12 line is enabled. Note that if ESP32 experiences a power-on reset while the SD card is sending data, high level on GPIO12 can be latched into the bootstrapping register, and ESP32 will enter a boot loop until external reset with correct GPIO12 level is applied. 11 | # * Another option is to program flash voltage selection efuses: set `XPD_SDIO_TIEH=1`, `XPD_SDIO_FORCE=1`, and `XPD_SDIO_REG = 1`. This will permanently select 3.3V output voltage for the internal regulator, and GPIO12 will not be used as a bootstrapping pin anymore. Then it is safe to connect a pullup resistor to GPIO12. This option is suggested for production use. 12 | 13 | # The following commands can be used to program flash voltage selection efuses **to 3.3V**: 14 | 15 | # Override flash regulator configuration using efuses 16 | /home/LoBo2_Razno/ESP32/esp-idf/components/esptool_py/esptool/espefuse.py --port /dev/ttyUSB0 burn_efuse XPD_SDIO_FORCE 17 | # Select 3.3V output voltage 18 | /home/LoBo2_Razno/ESP32/esp-idf/components/esptool_py/esptool/espefuse.py --port /dev/ttyUSB0 burn_efuse XPD_SDIO_TIEH 19 | # Enable internal voltage regulator 20 | /home/LoBo2_Razno/ESP32/esp-idf/components/esptool_py/esptool/espefuse.py --port /dev/ttyUSB0 burn_efuse XPD_SDIO_REG 21 | -------------------------------------------------------------------------------- /GDB: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export HOST_PLATFORM=linux 3 | export PATH=$PATH:/home/LoBo2_Razno/ESP32/xtensa-esp32-elf/bin 4 | export IDF_PATH=/home/LoBo2_Razno/ESP32/esp-idf 5 | 6 | #xtensa-esp32-elf-gdb ./build/lua_rtos.elf 7 | xtensa-esp32-elf-gdb ./build/lua_rtos.elf -b 115200 -ex 'target remote /dev/ttyUSB0' 8 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # This is a project Makefile. It is assumed the directory this Makefile resides in is a 3 | # project subdirectory. 4 | # 5 | 6 | PROJECT_NAME := lua_rtos 7 | 8 | all_binaries: configure-idf-lua-rtos configure-idf-lua-rtos-tests 9 | 10 | clean: restore-idf 11 | 12 | configure-idf-lua-rtos-tests: 13 | @echo "Configure esp-idf for Lua RTOS tests ..." 14 | @touch $(PROJECT_PATH)/components/lua_rtos/sys/sys_init.c 15 | @touch $(PROJECT_PATH)/components/lua_rtos/Lua/src/lbaselib.c 16 | 17 | configure-idf-lua-rtos: 18 | @echo "Configure esp-idf ..." 19 | @cd $(IDF_PATH)/components/lwip/api && git checkout api_msg.c 20 | @cd $(IDF_PATH)/components/spi_flash && git checkout flash_ops.c 21 | @cd $(IDF_PATH)/components/spi_flash/include && git checkout esp_spi_flash.h 22 | @cd $(IDF_PATH)/components/fatfs/src && git checkout ffconf.h 23 | @cd $(IDF_PATH)/components/fatfs/src/option && rm -f ccsbcs.c 24 | #@cd $(IDF_PATH)/components/freertos/include/freertos && git checkout FreeRTOSConfig.h 25 | @echo "Configure esp-idf for Lua RTOS ..." 26 | @touch $(PROJECT_PATH)/components/lua_rtos/lwip/socket.c 27 | @cd $(IDF_PATH)/components/lwip/api && git checkout api_msg.c 28 | @patch -f $(IDF_PATH)/components/lwip/api/api_msg.c $(PROJECT_PATH)/main/patches/api_msg.patch 29 | @cp -f $(PROJECT_PATH)/main/patches/ffconf.h $(IDF_PATH)/components/fatfs/src/ffconf.h 30 | @cp -f $(PROJECT_PATH)/main/patches/ccsbcs.c $(IDF_PATH)/components/fatfs/src/option/ccsbcs.c 31 | @patch -f $(IDF_PATH)/components/spi_flash/flash_ops.c $(PROJECT_PATH)/main/patches/spi_flash.1.patch 32 | @patch -f $(IDF_PATH)/components/spi_flash/include/esp_spi_flash.h $(PROJECT_PATH)/main/patches/spi_flash.2.patch 33 | #@patch -f $(IDF_PATH)/components/freertos/include/freertos/FreeRTOSConfig.h $(PROJECT_PATH)/main/patches/free_rtos_config.patch 34 | 35 | restore-idf: 36 | @echo "Restoring esp-idf ..." 37 | @cd $(IDF_PATH)/components/lwip/api && git checkout api_msg.c 38 | @cd $(IDF_PATH)/components/spi_flash && git checkout flash_ops.c 39 | @cd $(IDF_PATH)/components/spi_flash/include && git checkout esp_spi_flash.h 40 | @cd $(IDF_PATH)/components/fatfs/src && git checkout ffconf.h 41 | @cd $(IDF_PATH)/components/fatfs/src/option && rm -f ccsbcs.c 42 | #@cd $(IDF_PATH)/components/freertos/include/freertos && git checkout FreeRTOSConfig.h 43 | 44 | include $(IDF_PATH)/make/project.mk 45 | -------------------------------------------------------------------------------- /bin/bootloader.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/bin/bootloader.bin -------------------------------------------------------------------------------- /bin/lua_rtos.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/bin/lua_rtos.bin -------------------------------------------------------------------------------- /bin/partitions_singleapp.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/bin/partitions_singleapp.bin -------------------------------------------------------------------------------- /bin/read.me: -------------------------------------------------------------------------------- 1 | ** Built for Sparkfun ESP32 thing ** 2 | 3 | Flash with latest esptool 4 | 5 | https://github.com/espressif/esptool 6 | 7 | /esptool.py write_flash 0x1000 bootloader.bin 0x10000 lua_rtos.bin 0x8000 partitions_singleapp.bin 8 | 9 | -------------------------------------------------------------------------------- /components/http/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Component Makefile 3 | # 4 | 5 | COMPONENT_SRCDIRS := . 6 | COMPONENT_ADD_INCLUDEDIRS := . -------------------------------------------------------------------------------- /components/lua_rtos/Lua/adds/lrodefs.h: -------------------------------------------------------------------------------- 1 | /* Read-only tables helper */ 2 | 3 | #ifndef lrodefs_h 4 | #define lrodefs_h 5 | 6 | #include "lrotable.h" 7 | 8 | #if LUA_USE_ROTABLE 9 | #define LUA_REG_TYPE luaR_entry 10 | #define LSTRKEY LRO_STRKEY 11 | #define LNUMKEY LRO_NUMKEY 12 | #define LNILKEY LRO_NILKEY 13 | #define LFUNCVAL LRO_FUNCVAL 14 | #define LUDATA LRO_LUDATA 15 | #define LNUMVAL LRO_NUMVAL 16 | #define LINTVAL LRO_INTVAL 17 | #define LROVAL LRO_ROVAL 18 | #define LNILVAL LRO_NILVAL 19 | #define LREGISTER(L, name, table)\ 20 | return 0 21 | #else 22 | #define LUA_REG_TYPE luaL_Reg 23 | #define LSTRKEY(x) x 24 | #define LNILKEY NULL 25 | #define LFUNCVAL(x) x 26 | #define LNILVAL NULL 27 | #define LNUMVAL(x) x 28 | #define LINTVAL(x) x 29 | #define LROVAL(x) x 30 | 31 | #define LREGISTER(L, name, table)\ 32 | luaL_register(L, name, table);\ 33 | return 1 34 | #endif 35 | 36 | #endif /* lrodefs_h */ 37 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/adds/modules.h: -------------------------------------------------------------------------------- 1 | #ifndef _MODULES_H 2 | #define _MODULES_H 3 | 4 | #include "lrodefs.h" 5 | 6 | #define PUT_IN_SECTION(s) __attribute__((used,unused,section(s))) 7 | 8 | // Macros for register a library 9 | #define LIB_PASTER(x,y) x##y 10 | #define LIB_EVALUATOR(x,y) LIB_PASTER(x,y) 11 | #define LIB_CONCAT(x,y) LIB_EVALUATOR(x,y) 12 | 13 | #define LIB_TOSTRING_PASTER(x) #x 14 | #define LIB_TOSTRING_EVALUATOR(x) LIB_TOSTRING_PASTER(x) 15 | #define LIB_TOSTRING(x) LIB_TOSTRING_EVALUATOR(x) 16 | 17 | #define LIB_USED(fname) LIB_CONCAT(CONFIG_LUA_RTOS_LUA_USE_,fname) 18 | #define LIB_SECTION(fname, section) LIB_CONCAT(section,LIB_USED(fname)) 19 | 20 | #if LUA_USE_ROTABLE 21 | #define MODULE_REGISTER_MAPPED(fname, lname, map, func) \ 22 | const PUT_IN_SECTION(LIB_TOSTRING(LIB_SECTION(fname,.lua_libs))) luaL_Reg LIB_CONCAT(lua_libs,LIB_CONCAT(_,LIB_CONCAT(lname,LIB_USED(fname)))) = {LIB_TOSTRING(lname), func}; \ 23 | const PUT_IN_SECTION(LIB_TOSTRING(LIB_SECTION(fname,.lua_rotable))) luaR_entry LIB_CONCAT(lua_rotable,LIB_CONCAT(_,LIB_CONCAT(lname,LIB_USED(fname)))) = {LSTRKEY(LIB_TOSTRING(lname)), LROVAL(map)}; 24 | 25 | #define MODULE_REGISTER_UNMAPPED(fname, lname, func) \ 26 | const PUT_IN_SECTION(LIB_TOSTRING(LIB_SECTION(fname,.lua_libs))) luaL_Reg LIB_CONCAT(lua_libs,LIB_CONCAT(_,LIB_CONCAT(lname,LIB_USED(fname)))) = {LIB_TOSTRING(lname), func}; 27 | #else 28 | #define MODULE_REGISTER(fname, lname, map) 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/common/fpconv.h: -------------------------------------------------------------------------------- 1 | /* Lua CJSON floating point conversion routines */ 2 | 3 | /* Buffer required to store the largest string representation of a double. 4 | * 5 | * Longest double printed with %.14g is 21 characters long: 6 | * -1.7976931348623e+308 */ 7 | # define FPCONV_G_FMT_BUFSIZE 32 8 | 9 | #ifdef USE_INTERNAL_FPCONV 10 | static inline void fpconv_init() 11 | { 12 | /* Do nothing - not required */ 13 | } 14 | #else 15 | extern void fpconv_init(); 16 | #endif 17 | 18 | extern int fpconv_g_fmt(char*, double, int); 19 | extern double fpconv_strtod(const char*, char**); 20 | 21 | /* vi:ai et sw=4 ts=4: 22 | */ 23 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/common/linenoise.h: -------------------------------------------------------------------------------- 1 | /* linenoise.h -- VERSION 1.0 2 | * 3 | * Guerrilla line editing library against the idea that a line editing lib 4 | * needs to be 20,000 lines of C code. 5 | * 6 | * See linenoise.c for more information. 7 | * 8 | * ------------------------------------------------------------------------ 9 | * 10 | * Copyright (c) 2010-2014, Salvatore Sanfilippo 11 | * Copyright (c) 2010-2013, Pieter Noordhuis 12 | * 13 | * All rights reserved. 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are 17 | * met: 18 | * 19 | * * Redistributions of source code must retain the above copyright 20 | * notice, this list of conditions and the following disclaimer. 21 | * 22 | * * Redistributions in binary form must reproduce the above copyright 23 | * notice, this list of conditions and the following disclaimer in the 24 | * documentation and/or other materials provided with the distribution. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | */ 38 | 39 | #ifndef __LINENOISE_H 40 | #define __LINENOISE_H 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | int linenoise(char *buf, const char *prompt); 47 | void linenoiseClearScreen(void); 48 | void linenoiseSetMultiLine(int ml); 49 | void linenoisePrintKeyCodes(void); 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif /* __LINENOISE_H */ -------------------------------------------------------------------------------- /components/lua_rtos/Lua/common/shell.l: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | #include 4 | #include "y.tab.h" 5 | %} 6 | 7 | %% 8 | 9 | ^[ ]*([/\.]|[a-z]|[A-Z]|(0-9))+\.lua yylval.string=strdup(yytext);return SLUA_FILE; 10 | 11 | cat yylval.string=strdup(yytext);return SLUA_COMMAND_CAT; 12 | cd yylval.string=strdup(yytext);return SLUA_COMMAND_CD; 13 | clear yylval.string=strdup(yytext);return SLUA_COMMAND_CLEAR; 14 | cp yylval.string=strdup(yytext);return SLUA_COMMAND_CP; 15 | dmesg yylval.string=strdup(yytext);return SLUA_COMMAND_DMESG; 16 | edit yylval.string=strdup(yytext);return SLUA_COMMAND_EDIT; 17 | exit yylval.string=strdup(yytext);return SLUA_COMMAND_EXIT; 18 | ls yylval.string=strdup(yytext);return SLUA_COMMAND_LS; 19 | more yylval.string=strdup(yytext);return SLUA_COMMAND_MORE; 20 | mkdir yylval.string=strdup(yytext);return SLUA_COMMAND_MKDIR; 21 | mv yylval.string=strdup(yytext);return SLUA_COMMAND_MV; 22 | pwd yylval.string=strdup(yytext);return SLUA_COMMAND_PWD; 23 | rm yylval.string=strdup(yytext);return SLUA_COMMAND_RM; 24 | 25 | \n yylval.string=strdup(yytext);return SLUA_EOL; 26 | 27 | .|[ ] ; 28 | 29 | ([/\.-]|[a-z]|[A-Z]|(0-9))+ yylval.string=strdup(yytext);return SLUA_ARGUMENT; 30 | 31 | %% 32 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/common/y.tab.h: -------------------------------------------------------------------------------- 1 | #define SLUA_COMMAND_CAT 257 2 | #define SLUA_COMMAND_CD 258 3 | #define SLUA_COMMAND_CLEAR 259 4 | #define SLUA_COMMAND_CP 260 5 | #define SLUA_COMMAND_DMESG 261 6 | #define SLUA_COMMAND_EDIT 262 7 | #define SLUA_COMMAND_EXIT 263 8 | #define SLUA_COMMAND_LS 264 9 | #define SLUA_COMMAND_MORE 265 10 | #define SLUA_COMMAND_MKDIR 266 11 | #define SLUA_COMMAND_MV 267 12 | #define SLUA_COMMAND_PWD 268 13 | #define SLUA_COMMAND_RM 269 14 | #define SLUA_ARGUMENT 270 15 | #define SLUA_EOL 271 16 | #define SLUA_FILE 272 17 | #ifdef YYSTYPE 18 | #undef YYSTYPE_IS_DECLARED 19 | #define YYSTYPE_IS_DECLARED 1 20 | #endif 21 | #ifndef YYSTYPE_IS_DECLARED 22 | #define YYSTYPE_IS_DECLARED 1 23 | typedef union {char *string;} YYSTYPE; 24 | #endif /* !YYSTYPE_IS_DECLARED */ 25 | extern YYSTYPE yylval; 26 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/modules/error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, Lua helper functions for throw an error from a driver error 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef _LUA_ERROR_H 31 | #define _LUA_ERROR_H 32 | 33 | #include "lstate.h" 34 | 35 | #include 36 | 37 | #define LUA_I2C_ID I2C_DRIVER_ID 38 | #define LUA_MQTT_ID 30 39 | 40 | #define LUA_EXCEPTION_BASE(n) (n << 24) 41 | #define LUA_EXCEPTION_CODE(module, n) (LUA_EXCEPTION_BASE(LUA_##module##_ID) | n) 42 | 43 | int luaL_driver_error(lua_State* L, driver_error_t *error); 44 | 45 | #define luaL_exception(l, exception) \ 46 | luaL_error(l, \ 47 | "%d:%s", \ 48 | exception, \ 49 | driver_get_err_msg_by_exception(exception) \ 50 | ) 51 | 52 | #define luaL_exception_extended(l, exception, msg) \ 53 | luaL_error(l, \ 54 | "%d:%s (%s)", \ 55 | exception, \ 56 | driver_get_err_msg_by_exception(exception), \ 57 | msg \ 58 | ) 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/modules/event.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, event wrapper 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef LEVENT_H 31 | #define LEVENT_H 32 | 33 | #include 34 | #include 35 | 36 | #define EVENT_QUEUE_SIZE 4 37 | 38 | typedef struct { 39 | struct mtx mtx; 40 | struct list listener_list; 41 | } event_userdata; 42 | 43 | #endif /* LEVENT_H */ 44 | 45 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/modules/http.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, http server wrapper 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #if LUA_USE_HTTP 31 | 32 | #include "lua.h" 33 | #include "lauxlib.h" 34 | 35 | static int lhttp_start(lua_State* L) { 36 | http_start(); 37 | 38 | return 0; 39 | } 40 | 41 | static int lhttp_stop(lua_State* L) { 42 | http_stop(); 43 | 44 | return 0; 45 | } 46 | 47 | static const luaL_Reg lhttp[] = { 48 | {"start", lhttp_start}, 49 | {"stop", lhttp_stop}, 50 | {NULL, NULL} 51 | }; 52 | 53 | int luaopen_http(lua_State* L) 54 | { 55 | luaL_newlib(L, lhttp); 56 | 57 | return 1; 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/modules/i2c.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, I2C Lua module 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef _LI2C_H 31 | #define _LI2C_H 32 | 33 | #include "luartos.h" 34 | #include "modules.h" 35 | 36 | #include 37 | #include 38 | #include 39 | 40 | #ifdef CPU_I2C0 41 | #define I2C_I2C0 {LSTRKEY(CPU_I2C0_NAME), LINTVAL(CPU_I2C0)}, 42 | #else 43 | #define I2C_I2C0 44 | #endif 45 | 46 | #ifdef CPU_I2C1 47 | #define I2C_I2C1 {LSTRKEY(CPU_I2C1_NAME), LINTVAL(CPU_I2C1)}, 48 | #else 49 | #define I2C_I2C1 50 | #endif 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/modules/neopixel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, NEOPIXEL wrapper 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef LNEOPIXEL_H 31 | #define LNEOPIXEL_H 32 | 33 | #include "drivers/neopixel.h" 34 | 35 | typedef struct { 36 | uint32_t unit; 37 | } neopixel_userdata; 38 | 39 | #endif /* LNEOPIXEL_H */ 40 | 41 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/modules/net.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, Lua net module 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef LNET_H_ 31 | #define LNET_H_ 32 | 33 | #include 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/modules/net_service_sntp.inc: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, lua sntp module 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include "net.h" 31 | 32 | #include "lwip/err.h" 33 | #include "apps/sntp/sntp.h" 34 | 35 | #include 36 | 37 | static int lsntp_start(lua_State* L) { 38 | driver_error_t *error; 39 | 40 | if ((error = net_check_connectivity())) { 41 | return luaL_driver_error(L, error); 42 | } 43 | 44 | sntp_setoperatingmode(SNTP_OPMODE_POLL); 45 | sntp_setservername(0, "pool.ntp.org"); 46 | sntp_init(); 47 | 48 | return 0; 49 | } 50 | 51 | static int lsntp_stop(lua_State* L) { 52 | driver_error_t *error; 53 | 54 | if ((error = net_check_connectivity())) { 55 | return luaL_driver_error(L, error); 56 | } 57 | 58 | sntp_stop(); 59 | 60 | return 0; 61 | } 62 | 63 | static const LUA_REG_TYPE sntp_map[] = { 64 | { LSTRKEY( "start" ), LFUNCVAL( lsntp_start ) }, 65 | { LSTRKEY( "stop" ), LFUNCVAL( lsntp_stop ) }, 66 | { LNILKEY, LNILVAL } 67 | }; 68 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/modules/sensor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, sensor wrapper 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef LSENSOR_H 31 | #define LSENSOR_H 32 | 33 | #include 34 | 35 | #if CONFIG_LUA_RTOS_LUA_USE_SENSOR 36 | 37 | typedef struct { 38 | sensor_instance_t *instance; 39 | uint8_t adquired; 40 | } sensor_userdata; 41 | 42 | #endif 43 | 44 | #endif /* LSENSOR_H */ 45 | 46 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/modules/servo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, servo wrapper 3 | * 4 | * 5 | * Copyright (C) 2015 - 2017 6 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 7 | * 8 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 9 | * 10 | * All rights reserved. 11 | * 12 | * Permission to use, copy, modify, and distribute this software 13 | * and its documentation for any purpose and without fee is hereby 14 | * granted, provided that the above copyright notice appear in all 15 | * copies and that both that the copyright notice and this 16 | * permission notice and warranty disclaimer appear in supporting 17 | * documentation, and that the name of the author not be used in 18 | * advertising or publicity pertaining to distribution of the 19 | * software without specific, written prior permission. 20 | * 21 | * The author disclaim all warranties with regard to this 22 | * software, including all implied warranties of merchantability 23 | * and fitness. In no servo shall the author be liable for any 24 | * special, indirect or consequential damages or any damages 25 | * whatsoever resulting from loss of use, data or profits, whether 26 | * in an action of contract, negligence or other tortious action, 27 | * arising out of or in connection with the use or performance of 28 | * this software. 29 | */ 30 | 31 | #ifndef LSERVO_H 32 | #define LSERVO_H 33 | 34 | #if CONFIG_LUA_RTOS_LUA_USE_SERVO 35 | 36 | #include 37 | 38 | #include 39 | 40 | /* 41 | * Servo fundamentals 42 | * 43 | * Each 20 ms an active-high digital pulse controls the position, so 44 | * signal has a frequency of 50 hz. 45 | * 46 | * The pulse width goes from 1 ms to 2 ms, and 1.5 ms is the center of 47 | * range. 48 | * 49 | */ 50 | 51 | // Servo types 52 | #define SERVO_POSITIONAL 0 53 | #define SERVO_CONTINUOUS 1 54 | 55 | // This constants define the duty cycles needed for each servo direction: 56 | // stop, clockwise, or counter clock wise 57 | #define SERVO_STOP_DUTY 0.075 58 | #define SERVO_CW_DUTY 0.06 59 | #define SERVO_CCW_DUTY 0.08 60 | 61 | // User data for this module 62 | typedef struct { 63 | servo_instance_t *instance; 64 | } servo_userdata; 65 | 66 | #endif 67 | 68 | #endif /* LSERVO_H */ 69 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/modules/spi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, SPI wrapper 3 | * 4 | * Copyright (C) 2015 - 2016 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef LSPI_H 31 | #define LSPI_H 32 | 33 | #include "luartos.h" 34 | 35 | #include 36 | #include 37 | 38 | #ifdef CPU_SPI0 39 | #define SPI_SPI0 {LSTRKEY(CPU_SPI0_NAME), LINTVAL(CPU_SPI0)}, 40 | #else 41 | #define SPI_SPI0 42 | #endif 43 | 44 | #ifdef CPU_SPI1 45 | #define SPI_SPI1 {LSTRKEY(CPU_SPI1_NAME), LINTVAL(CPU_SPI1)}, 46 | #else 47 | #define SPI_SPI1 48 | #endif 49 | 50 | #ifdef CPU_SPI2 51 | #define SPI_SPI2 {LSTRKEY(CPU_SPI2_NAME), LINTVAL(CPU_SPI2)}, 52 | #else 53 | #define SPI_SPI2 54 | #endif 55 | 56 | #ifdef CPU_SPI3 57 | #define SPI_SPI3 {LSTRKEY(CPU_SPI3_NAME), LINTVAL(CPU_SPI3)}, 58 | #else 59 | #define SPI_SPI3 60 | #endif 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/modules/thread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, pthread wrapper for whitecat 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef LTHREAD_H 31 | #define LTHREAD_H 32 | 33 | #include "lstate.h" 34 | 35 | #include 36 | 37 | struct lthread { 38 | lua_State *PL; // Parent thread 39 | lua_State *L; // Thread state 40 | int function_ref; 41 | int thread_ref; 42 | int status; 43 | int thid; 44 | pthread_t thread; 45 | }; 46 | 47 | #endif /* LTHREAD_H */ 48 | 49 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/modules/uart.h: -------------------------------------------------------------------------------- 1 | #ifndef _LUA_UART_H 2 | #define _LUA_UART_H 3 | 4 | #include "modules.h" 5 | 6 | #include 7 | 8 | #ifdef CPU_UART0 9 | #define UART_UART0 {LSTRKEY(CPU_UART0_NAME), LINTVAL(CPU_UART0)}, 10 | #else 11 | #define UART_UART0 12 | #endif 13 | 14 | #ifdef CPU_UART1 15 | #define UART_UART1 {LSTRKEY(CPU_UART1_NAME), LINTVAL(CPU_UART1)}, 16 | #else 17 | #define UART_UART1 18 | #endif 19 | 20 | #ifdef CPU_UART2 21 | #define UART_UART2 {LSTRKEY(CPU_UART2_NAME), LINTVAL(CPU_UART2)}, 22 | #else 23 | #define UART_UART2 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/modules/untitled.txt: -------------------------------------------------------------------------------- 1 | i = 0 2 | while true do 3 | thread.start(function() i = i + 1 end) 4 | print("new "..i) 5 | end 6 | 7 | 8 | 9 | i = 0 10 | while true do 11 | thread.stop(); 12 | thread.start(function() i = i + 1;dofile("/examples/blink.lua"); end) 13 | print("new "..i) 14 | end -------------------------------------------------------------------------------- /components/lua_rtos/Lua/src/lapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lapi.h,v 2.9 2015/03/06 19:49:50 roberto Exp $ 3 | ** Auxiliary functions from Lua API 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lapi_h 8 | #define lapi_h 9 | 10 | 11 | #include "llimits.h" 12 | #include "lstate.h" 13 | 14 | #define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \ 15 | "stack overflow");} 16 | 17 | #define adjustresults(L,nres) \ 18 | { if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; } 19 | 20 | #define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \ 21 | "not enough elements in the stack") 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/src/lctype.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lctype.h,v 1.12 2011/07/15 12:50:29 roberto Exp $ 3 | ** 'ctype' functions for Lua 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lctype_h 8 | #define lctype_h 9 | 10 | #include "lua.h" 11 | 12 | 13 | /* 14 | ** WARNING: the functions defined here do not necessarily correspond 15 | ** to the similar functions in the standard C ctype.h. They are 16 | ** optimized for the specific needs of Lua 17 | */ 18 | 19 | #if !defined(LUA_USE_CTYPE) 20 | 21 | #if 'A' == 65 && '0' == 48 22 | /* ASCII case: can use its own tables; faster and fixed */ 23 | #define LUA_USE_CTYPE 0 24 | #else 25 | /* must use standard C ctype */ 26 | #define LUA_USE_CTYPE 1 27 | #endif 28 | 29 | #endif 30 | 31 | 32 | #if !LUA_USE_CTYPE /* { */ 33 | 34 | #include 35 | 36 | #include "llimits.h" 37 | 38 | 39 | #define ALPHABIT 0 40 | #define DIGITBIT 1 41 | #define PRINTBIT 2 42 | #define SPACEBIT 3 43 | #define XDIGITBIT 4 44 | 45 | 46 | #define MASK(B) (1 << (B)) 47 | 48 | 49 | /* 50 | ** add 1 to char to allow index -1 (EOZ) 51 | */ 52 | #define testprop(c,p) (luai_ctype_[(c)+1] & (p)) 53 | 54 | /* 55 | ** 'lalpha' (Lua alphabetic) and 'lalnum' (Lua alphanumeric) both include '_' 56 | */ 57 | #define lislalpha(c) testprop(c, MASK(ALPHABIT)) 58 | #define lislalnum(c) testprop(c, (MASK(ALPHABIT) | MASK(DIGITBIT))) 59 | #define lisdigit(c) testprop(c, MASK(DIGITBIT)) 60 | #define lisspace(c) testprop(c, MASK(SPACEBIT)) 61 | #define lisprint(c) testprop(c, MASK(PRINTBIT)) 62 | #define lisxdigit(c) testprop(c, MASK(XDIGITBIT)) 63 | 64 | /* 65 | ** this 'ltolower' only works for alphabetic characters 66 | */ 67 | #define ltolower(c) ((c) | ('A' ^ 'a')) 68 | 69 | 70 | /* two more entries for 0 and -1 (EOZ) */ 71 | LUAI_DDEC const lu_byte luai_ctype_[UCHAR_MAX + 2]; 72 | 73 | 74 | #else /* }{ */ 75 | 76 | /* 77 | ** use standard C ctypes 78 | */ 79 | 80 | #include 81 | 82 | 83 | #define lislalpha(c) (isalpha(c) || (c) == '_') 84 | #define lislalnum(c) (isalnum(c) || (c) == '_') 85 | #define lisdigit(c) (isdigit(c)) 86 | #define lisspace(c) (isspace(c)) 87 | #define lisprint(c) (isprint(c)) 88 | #define lisxdigit(c) (isxdigit(c)) 89 | 90 | #define ltolower(c) (tolower(c)) 91 | 92 | #endif /* } */ 93 | 94 | #endif 95 | 96 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/src/ldebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ldebug.h,v 2.14 2015/05/22 17:45:56 roberto Exp $ 3 | ** Auxiliary functions from Debug Interface module 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ldebug_h 8 | #define ldebug_h 9 | 10 | 11 | #include "lstate.h" 12 | 13 | 14 | #define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1) 15 | 16 | #define getfuncline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : -1) 17 | 18 | #define resethookcount(L) (L->hookcount = L->basehookcount) 19 | 20 | 21 | LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o, 22 | const char *opname); 23 | LUAI_FUNC l_noret luaG_concaterror (lua_State *L, const TValue *p1, 24 | const TValue *p2); 25 | LUAI_FUNC l_noret luaG_opinterror (lua_State *L, const TValue *p1, 26 | const TValue *p2, 27 | const char *msg); 28 | LUAI_FUNC l_noret luaG_tointerror (lua_State *L, const TValue *p1, 29 | const TValue *p2); 30 | LUAI_FUNC l_noret luaG_ordererror (lua_State *L, const TValue *p1, 31 | const TValue *p2); 32 | LUAI_FUNC l_noret luaG_runerror (lua_State *L, const char *fmt, ...); 33 | LUAI_FUNC const char *luaG_addinfo (lua_State *L, const char *msg, 34 | TString *src, int line); 35 | LUAI_FUNC l_noret luaG_errormsg (lua_State *L); 36 | LUAI_FUNC void luaG_traceexec (lua_State *L); 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/src/ldo.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ldo.h,v 2.29 2015/12/21 13:02:14 roberto Exp $ 3 | ** Stack and Call structure of Lua 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ldo_h 8 | #define ldo_h 9 | 10 | 11 | #include "lobject.h" 12 | #include "lstate.h" 13 | #include "lzio.h" 14 | 15 | 16 | /* 17 | ** Macro to check stack size and grow stack if needed. Parameters 18 | ** 'pre'/'pos' allow the macro to preserve a pointer into the 19 | ** stack across reallocations, doing the work only when needed. 20 | ** 'condmovestack' is used in heavy tests to force a stack reallocation 21 | ** at every check. 22 | */ 23 | #define luaD_checkstackaux(L,n,pre,pos) \ 24 | if (L->stack_last - L->top <= (n)) \ 25 | { pre; luaD_growstack(L, n); pos; } else { condmovestack(L,pre,pos); } 26 | 27 | /* In general, 'pre'/'pos' are empty (nothing to save) */ 28 | #define luaD_checkstack(L,n) luaD_checkstackaux(L,n,(void)0,(void)0) 29 | 30 | 31 | 32 | #define savestack(L,p) ((char *)(p) - (char *)L->stack) 33 | #define restorestack(L,n) ((TValue *)((char *)L->stack + (n))) 34 | 35 | 36 | /* type of protected functions, to be ran by 'runprotected' */ 37 | typedef void (*Pfunc) (lua_State *L, void *ud); 38 | 39 | LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name, 40 | const char *mode); 41 | LUAI_FUNC void luaD_hook (lua_State *L, int event, int line); 42 | LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults); 43 | LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults); 44 | LUAI_FUNC void luaD_callnoyield (lua_State *L, StkId func, int nResults); 45 | LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u, 46 | ptrdiff_t oldtop, ptrdiff_t ef); 47 | LUAI_FUNC int luaD_poscall (lua_State *L, CallInfo *ci, StkId firstResult, 48 | int nres); 49 | LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); 50 | LUAI_FUNC void luaD_growstack (lua_State *L, int n); 51 | LUAI_FUNC void luaD_shrinkstack (lua_State *L); 52 | LUAI_FUNC void luaD_inctop (lua_State *L); 53 | 54 | LUAI_FUNC l_noret luaD_throw (lua_State *L, int errcode); 55 | LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); 56 | 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/src/lfunc.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lfunc.h,v 2.15 2015/01/13 15:49:11 roberto Exp $ 3 | ** Auxiliary functions to manipulate prototypes and closures 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lfunc_h 8 | #define lfunc_h 9 | 10 | 11 | #include "lobject.h" 12 | 13 | 14 | #define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \ 15 | cast(int, sizeof(TValue)*((n)-1))) 16 | 17 | #define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \ 18 | cast(int, sizeof(TValue *)*((n)-1))) 19 | 20 | 21 | /* test whether thread is in 'twups' list */ 22 | #define isintwups(L) (L->twups != L) 23 | 24 | 25 | /* 26 | ** maximum number of upvalues in a closure (both C and Lua). (Value 27 | ** must fit in a VM register.) 28 | */ 29 | #define MAXUPVAL 255 30 | 31 | 32 | /* 33 | ** Upvalues for Lua closures 34 | */ 35 | struct UpVal { 36 | TValue *v; /* points to stack or to its own value */ 37 | lu_mem refcount; /* reference counter */ 38 | union { 39 | struct { /* (when open) */ 40 | UpVal *next; /* linked list */ 41 | int touched; /* mark to avoid cycles with dead threads */ 42 | } open; 43 | TValue value; /* the value (when closed) */ 44 | } u; 45 | }; 46 | 47 | #define upisopen(up) ((up)->v != &(up)->u.value) 48 | 49 | 50 | LUAI_FUNC Proto *luaF_newproto (lua_State *L); 51 | LUAI_FUNC CClosure *luaF_newCclosure (lua_State *L, int nelems); 52 | LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nelems); 53 | LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl); 54 | LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); 55 | LUAI_FUNC void luaF_close (lua_State *L, StkId level); 56 | LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); 57 | LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, 58 | int pc); 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/src/lprefix.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lprefix.h,v 1.2 2014/12/29 16:54:13 roberto Exp $ 3 | ** Definitions for Lua code that must come before any other header file 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lprefix_h 8 | #define lprefix_h 9 | 10 | 11 | /* 12 | ** Allows POSIX/XSI stuff 13 | */ 14 | #if !defined(LUA_USE_C89) /* { */ 15 | 16 | #if !defined(_XOPEN_SOURCE) 17 | #define _XOPEN_SOURCE 600 18 | #elif _XOPEN_SOURCE == 0 19 | #undef _XOPEN_SOURCE /* use -D_XOPEN_SOURCE=0 to undefine it */ 20 | #endif 21 | 22 | /* 23 | ** Allows manipulation of large files in gcc and some other compilers 24 | */ 25 | #if !defined(LUA_32BITS) && !defined(_FILE_OFFSET_BITS) 26 | #define _LARGEFILE_SOURCE 1 27 | #define _FILE_OFFSET_BITS 64 28 | #endif 29 | 30 | #endif /* } */ 31 | 32 | 33 | /* 34 | ** Windows stuff 35 | */ 36 | #if defined(_WIN32) /* { */ 37 | 38 | #if !defined(_CRT_SECURE_NO_WARNINGS) 39 | #define _CRT_SECURE_NO_WARNINGS /* avoid warnings about ISO C functions */ 40 | #endif 41 | 42 | #endif /* } */ 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/src/lstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lstring.h,v 1.61 2015/11/03 15:36:01 roberto Exp $ 3 | ** String table (keep all strings handled by Lua) 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lstring_h 8 | #define lstring_h 9 | 10 | #include "lgc.h" 11 | #include "lobject.h" 12 | #include "lstate.h" 13 | 14 | 15 | #define sizelstring(l) (sizeof(union UTString) + ((l) + 1) * sizeof(char)) 16 | 17 | #define sizeludata(l) (sizeof(union UUdata) + (l)) 18 | #define sizeudata(u) sizeludata((u)->len) 19 | 20 | #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ 21 | (sizeof(s)/sizeof(char))-1)) 22 | 23 | 24 | /* 25 | ** test whether a string is a reserved word 26 | */ 27 | #define isreserved(s) ((s)->tt == LUA_TSHRSTR && (s)->extra > 0) 28 | 29 | 30 | /* 31 | ** equality for short strings, which are always internalized 32 | */ 33 | #define eqshrstr(a,b) check_exp((a)->tt == LUA_TSHRSTR, (a) == (b)) 34 | 35 | 36 | LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int seed); 37 | LUAI_FUNC unsigned int luaS_hashlongstr (TString *ts); 38 | LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b); 39 | LUAI_FUNC void luaS_resize (lua_State *L, int newsize); 40 | LUAI_FUNC void luaS_clearcache (global_State *g); 41 | LUAI_FUNC void luaS_init (lua_State *L); 42 | LUAI_FUNC void luaS_remove (lua_State *L, TString *ts); 43 | LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s); 44 | LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); 45 | LUAI_FUNC TString *luaS_new (lua_State *L, const char *str); 46 | LUAI_FUNC TString *luaS_createlngstrobj (lua_State *L, size_t l); 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/src/ltm.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ltm.h,v 2.22 2016/02/26 19:20:15 roberto Exp $ 3 | ** Tag methods 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ltm_h 8 | #define ltm_h 9 | 10 | 11 | #include "lobject.h" 12 | 13 | 14 | /* 15 | * WARNING: if you change the order of this enumeration, 16 | * grep "ORDER TM" and "ORDER OP" 17 | */ 18 | typedef enum { 19 | TM_INDEX, 20 | TM_NEWINDEX, 21 | TM_GC, 22 | TM_MODE, 23 | TM_LEN, 24 | TM_EQ, /* last tag method with fast access */ 25 | TM_ADD, 26 | TM_SUB, 27 | TM_MUL, 28 | TM_MOD, 29 | TM_POW, 30 | TM_DIV, 31 | TM_IDIV, 32 | TM_BAND, 33 | TM_BOR, 34 | TM_BXOR, 35 | TM_SHL, 36 | TM_SHR, 37 | TM_UNM, 38 | TM_BNOT, 39 | TM_LT, 40 | TM_LE, 41 | TM_CONCAT, 42 | TM_CALL, 43 | TM_N /* number of elements in the enum */ 44 | } TMS; 45 | 46 | 47 | 48 | #define gfasttm(g,et,e) ((et) == NULL ? NULL : \ 49 | ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e])) 50 | 51 | #define fasttm(l,et,e) gfasttm(G(l), et, e) 52 | 53 | #define ttypename(x) luaT_typenames_[(x) + 1] 54 | 55 | LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS]; 56 | 57 | 58 | LUAI_FUNC const char *luaT_objtypename (lua_State *L, const TValue *o); 59 | 60 | LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename); 61 | LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, 62 | TMS event); 63 | LUAI_FUNC void luaT_init (lua_State *L); 64 | 65 | LUAI_FUNC void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1, 66 | const TValue *p2, TValue *p3, int hasres); 67 | LUAI_FUNC int luaT_callbinTM (lua_State *L, const TValue *p1, const TValue *p2, 68 | StkId res, TMS event); 69 | LUAI_FUNC void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, 70 | StkId res, TMS event); 71 | LUAI_FUNC int luaT_callorderTM (lua_State *L, const TValue *p1, 72 | const TValue *p2, TMS event); 73 | 74 | 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/src/lua.hpp: -------------------------------------------------------------------------------- 1 | // lua.hpp 2 | // Lua header files for C++ 3 | // <> not supplied automatically because Lua also compiles as C++ 4 | 5 | extern "C" { 6 | #include "lua.h" 7 | #include "lualib.h" 8 | #include "lauxlib.h" 9 | } 10 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/src/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lualib.h,v 1.45 2017/01/12 17:14:26 roberto Exp $ 3 | ** Lua standard libraries 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lualib_h 9 | #define lualib_h 10 | 11 | #include "lua.h" 12 | 13 | 14 | /* version suffix for environment variable names */ 15 | #define LUA_VERSUFFIX "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR 16 | 17 | 18 | LUAMOD_API int (luaopen_base) (lua_State *L); 19 | 20 | #define LUA_COLIBNAME "coroutine" 21 | LUAMOD_API int (luaopen_coroutine) (lua_State *L); 22 | 23 | #define LUA_TABLIBNAME "table" 24 | LUAMOD_API int (luaopen_table) (lua_State *L); 25 | 26 | #define LUA_IOLIBNAME "io" 27 | LUAMOD_API int (luaopen_io) (lua_State *L); 28 | 29 | #define LUA_OSLIBNAME "os" 30 | LUAMOD_API int (luaopen_os) (lua_State *L); 31 | 32 | #define LUA_STRLIBNAME "string" 33 | LUAMOD_API int (luaopen_string) (lua_State *L); 34 | 35 | #define LUA_UTF8LIBNAME "utf8" 36 | LUAMOD_API int (luaopen_utf8) (lua_State *L); 37 | 38 | #define LUA_BITLIBNAME "bit32" 39 | LUAMOD_API int (luaopen_bit32) (lua_State *L); 40 | 41 | #define LUA_MATHLIBNAME "math" 42 | LUAMOD_API int (luaopen_math) (lua_State *L); 43 | 44 | #define LUA_DBLIBNAME "debug" 45 | LUAMOD_API int (luaopen_debug) (lua_State *L); 46 | 47 | #define LUA_LOADLIBNAME "package" 48 | LUAMOD_API int (luaopen_package) (lua_State *L); 49 | 50 | 51 | /* open all previous libraries */ 52 | LUALIB_API void (luaL_openlibs) (lua_State *L); 53 | 54 | 55 | 56 | #if !defined(lua_assert) 57 | #define lua_assert(x) ((void)0) 58 | #endif 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/src/lundump.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lundump.h,v 1.45 2015/09/08 15:41:05 roberto Exp $ 3 | ** load precompiled Lua chunks 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lundump_h 8 | #define lundump_h 9 | 10 | #include "llimits.h" 11 | #include "lobject.h" 12 | #include "lzio.h" 13 | 14 | 15 | /* data to catch conversion errors */ 16 | #define LUAC_DATA "\x19\x93\r\n\x1a\n" 17 | 18 | #define LUAC_INT 0x5678 19 | #define LUAC_NUM cast_num(370.5) 20 | 21 | #define MYINT(s) (s[0]-'0') 22 | #define LUAC_VERSION (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR)) 23 | #define LUAC_FORMAT 0 /* this is the official format */ 24 | 25 | /* load one chunk; from lundump.c */ 26 | LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name); 27 | 28 | /* dump one chunk; from ldump.c */ 29 | LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, 30 | void* data, int strip); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/src/lzio.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lzio.c,v 1.37 2015/09/08 15:41:05 roberto Exp $ 3 | ** Buffered streams 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #define lzio_c 8 | #define LUA_CORE 9 | 10 | #include "lprefix.h" 11 | 12 | 13 | #include 14 | 15 | #include "lua.h" 16 | 17 | #include "llimits.h" 18 | #include "lmem.h" 19 | #include "lstate.h" 20 | #include "lzio.h" 21 | 22 | 23 | int luaZ_fill (ZIO *z) { 24 | size_t size; 25 | lua_State *L = z->L; 26 | const char *buff; 27 | lua_unlock(L); 28 | buff = z->reader(L, z->data, &size); 29 | lua_lock(L); 30 | if (buff == NULL || size == 0) 31 | return EOZ; 32 | z->n = size - 1; /* discount char being returned */ 33 | z->p = buff; 34 | return cast_uchar(*(z->p++)); 35 | } 36 | 37 | 38 | void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) { 39 | z->L = L; 40 | z->reader = reader; 41 | z->data = data; 42 | z->n = 0; 43 | z->p = NULL; 44 | } 45 | 46 | 47 | /* --------------------------------------------------------------- read --- */ 48 | size_t luaZ_read (ZIO *z, void *b, size_t n) { 49 | while (n) { 50 | size_t m; 51 | if (z->n == 0) { /* no bytes in buffer? */ 52 | if (luaZ_fill(z) == EOZ) /* try to read more */ 53 | return n; /* no more input; return number of missing bytes */ 54 | else { 55 | z->n++; /* luaZ_fill consumed first byte; put it back */ 56 | z->p--; 57 | } 58 | } 59 | m = (n <= z->n) ? n : z->n; /* min. between n and z->n */ 60 | memcpy(b, z->p, m); 61 | z->n -= m; 62 | z->p += m; 63 | b = (char *)b + m; 64 | n -= m; 65 | } 66 | return 0; 67 | } 68 | 69 | -------------------------------------------------------------------------------- /components/lua_rtos/Lua/src/lzio.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lzio.h,v 1.31 2015/09/08 15:41:05 roberto Exp $ 3 | ** Buffered streams 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lzio_h 9 | #define lzio_h 10 | 11 | #include "lua.h" 12 | 13 | #include "lmem.h" 14 | 15 | 16 | #define EOZ (-1) /* end of stream */ 17 | 18 | typedef struct Zio ZIO; 19 | 20 | #define zgetc(z) (((z)->n--)>0 ? cast_uchar(*(z)->p++) : luaZ_fill(z)) 21 | 22 | 23 | typedef struct Mbuffer { 24 | char *buffer; 25 | size_t n; 26 | size_t buffsize; 27 | } Mbuffer; 28 | 29 | #define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0) 30 | 31 | #define luaZ_buffer(buff) ((buff)->buffer) 32 | #define luaZ_sizebuffer(buff) ((buff)->buffsize) 33 | #define luaZ_bufflen(buff) ((buff)->n) 34 | 35 | #define luaZ_buffremove(buff,i) ((buff)->n -= (i)) 36 | #define luaZ_resetbuffer(buff) ((buff)->n = 0) 37 | 38 | 39 | #define luaZ_resizebuffer(L, buff, size) \ 40 | ((buff)->buffer = luaM_reallocvchar(L, (buff)->buffer, \ 41 | (buff)->buffsize, size), \ 42 | (buff)->buffsize = size) 43 | 44 | #define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0) 45 | 46 | 47 | LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, 48 | void *data); 49 | LUAI_FUNC size_t luaZ_read (ZIO* z, void *b, size_t n); /* read next n bytes */ 50 | 51 | 52 | 53 | /* --------- Private Part ------------------ */ 54 | 55 | struct Zio { 56 | size_t n; /* bytes still unread */ 57 | const char *p; /* current position in buffer */ 58 | lua_Reader reader; /* reader function */ 59 | void *data; /* additional data */ 60 | lua_State *L; /* Lua state (for reader) */ 61 | }; 62 | 63 | 64 | LUAI_FUNC int luaZ_fill (ZIO *z); 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /components/lua_rtos/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Component Makefile 3 | # 4 | 5 | COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive -L$(COMPONENT_PATH)/ld -T lua_rtos.ld -llua_rtos 6 | 7 | COMPONENT_SRCDIRS := . luartos_build.h freertos vfs editor sys unix syscalls math drivers lmic sensors \ 8 | sys/machine pthread Lua/common Lua/modules Lua/modules/screen Lua/platform Lua/src lwip 9 | 10 | COMPONENT_ADD_INCLUDEDIRS := . ./../spiffs include/freertos Lua/adds Lua/common Lua/modules Lua/platform Lua/src \ 11 | lmic ./../ vfs 12 | 13 | COMPONENT_PRIV_INCLUDEDIRS := -------------------------------------------------------------------------------- /components/lua_rtos/drivers/adc_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, ADC internal driver 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef _ADC_INTERNAL_H 31 | #define _ADC_INTERNAL_H 32 | 33 | #include 34 | 35 | driver_error_t *adc_internal_setup(int8_t unit, int8_t channel); 36 | driver_error_t *adc_internal_read(int8_t unit, int8_t channel, int *raw); 37 | 38 | #endif /* _ADC_INTERNAL_H */ 39 | -------------------------------------------------------------------------------- /components/lua_rtos/drivers/adc_mcp3008.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, ADC MCP3008 driver 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | #ifndef _ADC_MCP3008_H 30 | #define _ADC_MCP3008_H 31 | 32 | #include 33 | 34 | #define ADC_MCP3008_SPEED 20 35 | 36 | driver_error_t *adc_mcp3008_setup(int8_t unit, int8_t channel, uint8_t spi, uint8_t cs); 37 | driver_error_t *adc_mcp3008_read(int8_t unit, int8_t channel, int *raw); 38 | 39 | #endif /* _ADC_MCP3008_H */ 40 | -------------------------------------------------------------------------------- /components/lua_rtos/drivers/adc_mcp3208.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, ADC MCP3208 driver 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | #ifndef _ADC_MCP3208_H 30 | #define _ADC_MCP3208_H 31 | 32 | #include 33 | 34 | #define ADC_MCP3208_SPEED 20 35 | 36 | driver_error_t *adc_mcp3208_setup(int8_t unit, int8_t channel, uint8_t spi, uint8_t cs); 37 | driver_error_t *adc_mcp3208_read(int8_t unit, int8_t channel, int *raw); 38 | 39 | #endif /* _ADC_MCP3208_H */ 40 | -------------------------------------------------------------------------------- /components/lua_rtos/drivers/clock.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, clock driver 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include "luartos.h" 31 | 32 | #include "freertos/FreeRTOS.h" 33 | #include "esp_freertos_hooks.h" 34 | #include "esp_attr.h" 35 | 36 | #include 37 | 38 | #include 39 | 40 | #if USE_LED_ACT 41 | static volatile uint64_t tdelta = 0; 42 | 43 | unsigned int activity = 0; 44 | 45 | void IRAM_ATTR newTick(void) { 46 | tdelta++; 47 | if (tdelta == configTICK_RATE_HZ) { 48 | // 1 second since last second 49 | tdelta = 0; 50 | 51 | if (activity <= 0) { 52 | activity = 0; 53 | gpio_ll_pin_inv(LED_ACT); 54 | } 55 | } 56 | } 57 | 58 | #endif 59 | 60 | void _clock_init(void) { 61 | #if USE_LED_ACT 62 | esp_register_freertos_tick_hook(&newTick); 63 | #endif 64 | } 65 | -------------------------------------------------------------------------------- /components/lua_rtos/drivers/net.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, network manager 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef NET_H_ 31 | #define NET_H_ 32 | 33 | #include "lwip/err.h" 34 | #include "lwip/sockets.h" 35 | #include "lwip/sys.h" 36 | #include "lwip/netdb.h" 37 | #include "lwip/dns.h" 38 | #include "lwip/ip_addr.h" 39 | 40 | #include 41 | #include 42 | 43 | #define NETWORK_AVAILABLE() (status_get(STATUS_WIFI_CONNECTED)) 44 | 45 | typedef struct { 46 | ip4_addr_t ip; 47 | ip4_addr_t netmask; 48 | ip4_addr_t gw; 49 | uint8_t mac[6]; 50 | } ifconfig_t; 51 | 52 | // NET errors 53 | #define NET_ERR_NOT_AVAILABLE (DRIVER_EXCEPTION_BASE(NET_DRIVER_ID) | 0) 54 | 55 | driver_error_t *net_check_connectivity(); 56 | driver_error_t *net_lookup(const char *name, struct sockaddr_in *address); 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /components/lua_rtos/drivers/nzr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, NZR driver 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | /* 31 | * This driver implements NZR data transfers over a GPIO. 32 | */ 33 | 34 | #ifndef NZR_H_ 35 | #define NZR_H_ 36 | 37 | #include 38 | 39 | typedef struct { 40 | uint32_t t0h; //T0H in cycles 41 | uint32_t t0l; //T0L in cycles 42 | uint32_t t1h; //T1H in cycles 43 | uint32_t t1l; //T1L in cycles 44 | uint32_t res; //RES in cycles 45 | } nzr_timing_t; 46 | 47 | typedef struct { 48 | uint8_t gpio; 49 | nzr_timing_t timings; 50 | } nzr_instance_t; 51 | 52 | // NZR errors 53 | #define NZR_ERR_NOT_ENOUGH_MEMORY (DRIVER_EXCEPTION_BASE(NZR_DRIVER_ID) | 0) 54 | #define NRZ_ERR_INVALID_UNIT (DRIVER_EXCEPTION_BASE(NZR_DRIVER_ID) | 1) 55 | 56 | driver_error_t *nzr_setup(nzr_timing_t *timing, uint8_t gpio, uint32_t *unit); 57 | driver_error_t *nzr_send(uint32_t unit, uint8_t *data, uint32_t bits); 58 | 59 | #endif /* NZR_H_ */ 60 | -------------------------------------------------------------------------------- /components/lua_rtos/drivers/power_bus.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, power bus driver 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include "luartos.h" 31 | 32 | #if CONFIG_LUA_RTOS_USE_POWER_BUS 33 | 34 | #include 35 | 36 | #include 37 | #include 38 | 39 | static int power = 0; 40 | 41 | DRIVER_REGISTER_ERROR(PWBUS, pwbus, InvalidPin, "invalid pin", PWBUS_ERR_INVALID_PIN); 42 | 43 | /* 44 | * Helper functions 45 | */ 46 | static void _pwbus_init() { 47 | gpio_pin_output(CONFIG_LUA_RTOS_POWER_BUS_PIN); 48 | gpio_pin_clr(CONFIG_LUA_RTOS_POWER_BUS_PIN); 49 | power = 0; 50 | } 51 | 52 | /* 53 | * Operation functions 54 | */ 55 | driver_error_t *pwbus_on() { 56 | if (power) return NULL; 57 | 58 | gpio_pin_set(CONFIG_LUA_RTOS_POWER_BUS_PIN); 59 | power = 1; 60 | 61 | return NULL; 62 | } 63 | 64 | driver_error_t *pwbus_off() { 65 | if (!power) return NULL; 66 | 67 | gpio_pin_clr(CONFIG_LUA_RTOS_POWER_BUS_PIN); 68 | power = 0; 69 | 70 | return NULL; 71 | } 72 | 73 | DRIVER_REGISTER(PWBUS,pwbus,NULL,_pwbus_init,NULL); 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /components/lua_rtos/drivers/power_bus.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, power bus driver 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef _POWER_BUS_H 31 | #define _POWER_BUS_H 32 | 33 | #include 34 | 35 | // POWERBUS errors 36 | #define PWBUS_ERR_INVALID_PIN (DRIVER_EXCEPTION_BASE(PWBUS_DRIVER_ID) | 0) 37 | 38 | driver_error_t *pwbus_on(); 39 | driver_error_t *pwbus_off(); 40 | 41 | #endif /* _POWER_BUS_H */ 42 | -------------------------------------------------------------------------------- /components/lua_rtos/drivers/pwm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, PWM driver 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef PWM_H 31 | #define PWM_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | // Resources used by PWM 38 | typedef struct { 39 | uint8_t pin; 40 | uint8_t timer; 41 | } pwm_resources_t; 42 | 43 | // PWM errors 44 | #define PWM_ERR_CANT_INIT (DRIVER_EXCEPTION_BASE(PWM_DRIVER_ID) | 0) 45 | #define PWM_ERR_INVALID_UNIT (DRIVER_EXCEPTION_BASE(PWM_DRIVER_ID) | 1) 46 | #define PWM_ERR_INVALID_CHANNEL (DRIVER_EXCEPTION_BASE(PWM_DRIVER_ID) | 2) 47 | #define PWM_ERR_INVALID_DUTY (DRIVER_EXCEPTION_BASE(PWM_DRIVER_ID) | 3) 48 | 49 | driver_error_t *pwm_setup(int8_t unit); 50 | driver_error_t *pwm_setup_channel(int8_t unit, int8_t channel, int8_t pin, int32_t freq, double duty, int8_t *achannel); 51 | driver_error_t *pwm_start(int8_t unit, int8_t channel); 52 | driver_error_t *pwm_stop(int8_t unit, int8_t channel); 53 | driver_error_t *pwm_set_duty(int8_t unit, int8_t channel, double duty); 54 | 55 | #endif /* PWM_H */ 56 | 57 | -------------------------------------------------------------------------------- /components/lua_rtos/drivers/sd.h: -------------------------------------------------------------------------------- 1 | #ifndef SD_H 2 | #define SD_H 3 | 4 | #define NSD 1 5 | #define NPARTITIONS 4 6 | #define SECTSIZE 512 7 | #define MBR_MAGIC 0xaa55 8 | 9 | int sd_init(int unit); 10 | int card_write(int unit, unsigned offset, char *data, unsigned bcount); 11 | int card_read(int unit, unsigned int offset, char *data, unsigned int bcount); 12 | int sd_has_partition(int unit, int type); 13 | int sd_has_partitions(int unit); 14 | int card_size(int unit); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /components/lua_rtos/drivers/servo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, servo driver 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef _SERVO_H_ 31 | #define _SERVO_H_ 32 | 33 | #include "luartos.h" 34 | 35 | #if CONFIG_LUA_RTOS_LUA_USE_SERVO 36 | 37 | #include 38 | 39 | #define SERVO_MID 1444 40 | #define SERVO_USEC_PER_DEG 10 41 | 42 | // Pulse width for middle position 43 | //#define SERVO_MID SERVO_MIN + SERVO_WIDTH 44 | 45 | // Servo instance 46 | typedef struct servo_instance { 47 | int8_t pin; 48 | uint16_t value; 49 | int8_t pwm_channel; 50 | } servo_instance_t; 51 | 52 | // Servo errors 53 | #define SERVO_ERR_CANT_INIT (DRIVER_EXCEPTION_BASE(SERVO_DRIVER_ID) | 0) 54 | #define SERVO_ERR_NOT_ENOUGH_MEMORY (DRIVER_EXCEPTION_BASE(SERVO_DRIVER_ID) | 1) 55 | 56 | // Driver functions 57 | driver_error_t *servo_setup(int8_t pin, servo_instance_t **instance); 58 | driver_error_t *servo_write(servo_instance_t *instance, double value); 59 | 60 | #endif 61 | 62 | #endif /* _SERVO_H_ */ 63 | -------------------------------------------------------------------------------- /components/lua_rtos/freertos/adds.h: -------------------------------------------------------------------------------- 1 | #include "lua.h" 2 | 3 | #include "freertos/FreeRTOS.h" 4 | #include "freertos/task.h" 5 | 6 | #include 7 | 8 | typedef struct { 9 | uint32_t stack; 10 | uint32_t coreid; 11 | int32_t threadid; 12 | uint32_t signaled; 13 | lua_State *L; 14 | } lua_rtos_tcb_t; 15 | 16 | // This macro is not present in all FreeRTOS ports. In Lua RTOS is used in some places 17 | // in the source code shared by all the supported platforms. ESP32 don't define this macro, 18 | // so we define it for reuse code beetween platforms. 19 | #define portEND_SWITCHING_ISR(xSwitchRequired) \ 20 | if (xSwitchRequired) { \ 21 | _frxt_setup_switch(); \ 22 | } 23 | 24 | #if 0 25 | void enter_critical_section(); 26 | void exit_critical_section(); 27 | #endif 28 | 29 | UBaseType_t uxGetTaskId(); 30 | UBaseType_t uxGetThreadId(); 31 | void uxSetThreadId(UBaseType_t id); 32 | void uxSetLuaState(lua_State* L); 33 | lua_State* pvGetLuaState(); 34 | void uxSetSignaled(TaskHandle_t h, int s); 35 | uint32_t uxGetSignaled(TaskHandle_t h); 36 | TaskHandle_t xGetCurrentTask(); 37 | uint8_t uxGetCoreID(TaskHandle_t h); 38 | void uxSetCoreID(int core); 39 | int uxGetStack(TaskHandle_t h); 40 | void uxSetStack(int stack); 41 | -------------------------------------------------------------------------------- /components/lua_rtos/luartos: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/lua_rtos/luartos -------------------------------------------------------------------------------- /components/lua_rtos/lwip/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Component Makefile 3 | # 4 | 5 | COMPONENT_SRCDIRS := . 6 | COMPONENT_ADD_INCLUDEDIRS := . 7 | COMPONENT_PRIV_INCLUDEDIRS := -------------------------------------------------------------------------------- /components/lua_rtos/math/e_remainder.c: -------------------------------------------------------------------------------- 1 | /* @(#)e_remainder.c 5.1 93/09/24 */ 2 | /* 3 | * ==================================================== 4 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 5 | * 6 | * Developed at SunPro, a Sun Microsystems, Inc. business. 7 | * Permission to use, copy, modify, and distribute this 8 | * software is freely granted, provided that this notice 9 | * is preserved. 10 | * ==================================================== 11 | */ 12 | 13 | /* __ieee754_remainder(x,p) 14 | * Return : 15 | * returns x REM p = x - [x/p]*p as if in infinite 16 | * precise arithmetic, where [x/p] is the (infinite bit) 17 | * integer nearest x/p (in half way case choose the even one). 18 | * Method : 19 | * Based on fmod() return x-[x/p]chopped*p exactlp. 20 | */ 21 | 22 | #include "fdlibm.h" 23 | 24 | #ifndef _DOUBLE_IS_32BITS 25 | 26 | #ifdef __STDC__ 27 | static const double zero = 0.0; 28 | #else 29 | static double zero = 0.0; 30 | #endif 31 | 32 | 33 | #ifdef __STDC__ 34 | double __ieee754_remainder(double x, double p) 35 | #else 36 | double __ieee754_remainder(x,p) 37 | double x,p; 38 | #endif 39 | { 40 | __int32_t hx,hp; 41 | __uint32_t sx,lx,lp; 42 | double p_half; 43 | 44 | EXTRACT_WORDS(hx,lx,x); 45 | EXTRACT_WORDS(hp,lp,p); 46 | sx = hx&0x80000000; 47 | hp &= 0x7fffffff; 48 | hx &= 0x7fffffff; 49 | 50 | /* purge off exception values */ 51 | if((hp|lp)==0) return (x*p)/(x*p); /* p = 0 */ 52 | if((hx>=0x7ff00000)|| /* x not finite */ 53 | ((hp>=0x7ff00000)&& /* p is NaN */ 54 | (((hp-0x7ff00000)|lp)!=0))) 55 | return (x*p)/(x*p); 56 | 57 | 58 | if (hp<=0x7fdfffff) x = __ieee754_fmod(x,p+p); /* now x < 2p */ 59 | if (((hx-hp)|(lx-lp))==0) return zero*x; 60 | x = fabs(x); 61 | p = fabs(p); 62 | if (hp<0x00200000) { 63 | if(x+x>p) { 64 | x-=p; 65 | if(x+x>=p) x -= p; 66 | } 67 | } else { 68 | p_half = 0.5*p; 69 | if(x>p_half) { 70 | x-=p; 71 | if(x>=p_half) x -= p; 72 | } 73 | } 74 | GET_HIGH_WORD(hx,x); 75 | SET_HIGH_WORD(x,hx^sx); 76 | return x; 77 | } 78 | 79 | #endif /* defined(_DOUBLE_IS_32BITS) */ 80 | -------------------------------------------------------------------------------- /components/lua_rtos/math/ef_remainder.c: -------------------------------------------------------------------------------- 1 | /* ef_remainder.c -- float version of e_remainder.c. 2 | * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 | */ 4 | 5 | /* 6 | * ==================================================== 7 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 | * 9 | * Developed at SunPro, a Sun Microsystems, Inc. business. 10 | * Permission to use, copy, modify, and distribute this 11 | * software is freely granted, provided that this notice 12 | * is preserved. 13 | * ==================================================== 14 | */ 15 | 16 | #include "fdlibm.h" 17 | 18 | #ifdef __STDC__ 19 | static const float zero = 0.0; 20 | #else 21 | static float zero = 0.0; 22 | #endif 23 | 24 | 25 | #ifdef __STDC__ 26 | float __ieee754_remainderf(float x, float p) 27 | #else 28 | float __ieee754_remainderf(x,p) 29 | float x,p; 30 | #endif 31 | { 32 | __int32_t hx,hp; 33 | __uint32_t sx; 34 | float p_half; 35 | 36 | GET_FLOAT_WORD(hx,x); 37 | GET_FLOAT_WORD(hp,p); 38 | sx = hx&0x80000000; 39 | hp &= 0x7fffffff; 40 | hx &= 0x7fffffff; 41 | 42 | /* purge off exception values */ 43 | if(FLT_UWORD_IS_ZERO(hp)|| 44 | !FLT_UWORD_IS_FINITE(hx)|| 45 | FLT_UWORD_IS_NAN(hp)) 46 | return (x*p)/(x*p); 47 | 48 | 49 | if (hp<=FLT_UWORD_HALF_MAX) x = __ieee754_fmodf(x,p+p); /* now x < 2p */ 50 | if ((hx-hp)==0) return zero*x; 51 | x = fabsf(x); 52 | p = fabsf(p); 53 | if (hp<0x01000000) { 54 | if(x+x>p) { 55 | x-=p; 56 | if(x+x>=p) x -= p; 57 | } 58 | } else { 59 | p_half = (float)0.5*p; 60 | if(x>p_half) { 61 | x-=p; 62 | if(x>=p_half) x -= p; 63 | } 64 | } 65 | GET_FLOAT_WORD(hx,x); 66 | SET_FLOAT_WORD(x,hx^sx); 67 | return x; 68 | } 69 | -------------------------------------------------------------------------------- /components/lua_rtos/pthread/cleanup.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, pthread implementation over FreeRTOS 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | extern struct list thread_list; 35 | 36 | void pthread_cleanup_push(void (*routine)(void *), void *arg) { 37 | struct pthread *thread; 38 | struct pthread_clean *clean; 39 | int res, idx; 40 | 41 | // Get current thread 42 | res = list_get(&thread_list, pthread_self(), (void **)&thread); 43 | if (res == 0){ 44 | clean =(struct pthread_clean *) malloc(sizeof(struct pthread_clean)); 45 | if (!clean) { 46 | return; 47 | } 48 | 49 | clean->clean = routine; 50 | clean->args = arg; 51 | 52 | list_add(&thread->clean_list, clean, &idx); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /components/lua_rtos/pthread/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | #Component Makefile 3 | # 4 | COMPONENT_SRCDIRS := . test 5 | -------------------------------------------------------------------------------- /components/lua_rtos/pthread/join.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, pthread implementation over FreeRTOS 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include 31 | #include 32 | 33 | int pthread_join(pthread_t thread, void **value_ptr) { 34 | int res; 35 | 36 | res = _pthread_join(thread); 37 | if (res) { 38 | errno = res; 39 | return res; 40 | } 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /components/lua_rtos/pthread/once.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, pthread implementation over FreeRTOS 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include 31 | #include 32 | 33 | extern struct mtx once_mtx; 34 | 35 | int pthread_once(pthread_once_t *once_control, void (*init_routine)(void)) { 36 | // Init once_control, if not 37 | mtx_lock(&once_mtx); 38 | #if !MTX_USE_EVENTS 39 | if (once_control->mutex.sem == NULL) { 40 | mtx_init(&once_control->mutex, NULL, NULL, 0); 41 | } 42 | #else 43 | if (once_control->mutex.mtxid == 0) { 44 | mtx_init(&once_control->mutex, NULL, NULL, 0); 45 | } 46 | #endif 47 | // Excec init_routine, if needed 48 | if (mtx_trylock(&once_control->mutex)) { 49 | init_routine(); 50 | } 51 | 52 | mtx_unlock(&once_mtx); 53 | 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /components/lua_rtos/pthread/self.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, pthread implementation over FreeRTOS 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include "pthread.h" 31 | 32 | #include "esp_attr.h" 33 | 34 | extern UBaseType_t uxGetThreadId(); 35 | 36 | pthread_t IRAM_ATTR pthread_self(void) { 37 | return (pthread_t)uxGetThreadId(); 38 | } 39 | -------------------------------------------------------------------------------- /components/lua_rtos/sensors/2y0a21.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, 2Y0A21 sensor (proximity) 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include "luartos.h" 31 | 32 | #if 0 33 | 34 | #include 35 | #include 36 | 37 | driver_error_t *s2y0a21_setup(sensor_instance_t *unit); 38 | driver_error_t *s2y0a21_acquire(sensor_instance_t *unit, sensor_value_t *values); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /components/lua_rtos/sensors/dht11.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, DHT11 sensor (temperature & humidity) 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include "luartos.h" 31 | 32 | #if CONFIG_LUA_RTOS_LUA_USE_SENSOR 33 | 34 | #include 35 | 36 | #include 37 | 38 | driver_error_t *dht11_setup(sensor_instance_t *unit); 39 | driver_error_t *dht11_acquire(sensor_instance_t *unit, sensor_value_t *values); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /components/lua_rtos/sensors/ping28015.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, PING))) #28015 sensor (Distance Sensor) 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include "luartos.h" 31 | 32 | #if CONFIG_LUA_RTOS_LUA_USE_SENSOR 33 | 34 | #include 35 | #include 36 | 37 | driver_error_t *ping28015_setup(sensor_instance_t *unit); 38 | driver_error_t *ping28015_acquire(sensor_instance_t *unit, sensor_value_t *values); 39 | driver_error_t *ping28015_set(sensor_instance_t *unit, const char *id, sensor_value_t *setting); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /components/lua_rtos/sensors/tmp36.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, TMP36 sensor (temperature) 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include "luartos.h" 31 | 32 | #if CONFIG_LUA_RTOS_LUA_USE_SENSOR 33 | 34 | #include 35 | #include 36 | 37 | driver_error_t *tmp36_setup(sensor_instance_t *unit); 38 | driver_error_t *tmp36_acquire(sensor_instance_t *unit, sensor_value_t *values); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /components/lua_rtos/sys/build.h: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /components/lua_rtos/sys/console.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, some console utility functions 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | #ifndef CONSOLE_H 30 | #define CONSOLE_H 31 | 32 | void console_clear(); 33 | void console_size(int *rows, int *cols); 34 | void console_gotoxy(int col, int line); 35 | void console_statusline(const char *text1, const char *text2); 36 | void console_clearstatusline(); 37 | void console_erase_eol(); 38 | void console_erase_sol(); 39 | void console_erase_l(); 40 | void console_hide_cursor(); 41 | void console_show_cursor(); 42 | 43 | #endif /* CONSOLE_H */ 44 | 45 | -------------------------------------------------------------------------------- /components/lua_rtos/sys/debug.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, some debug functions 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include "debug.h" 31 | 32 | #if LED_DBG 33 | #include 34 | #endif 35 | 36 | void debug_led_on() { 37 | #if LED_DBG 38 | gpio_pin_output(LED_DBG); 39 | gpio_pin_set(LED_DBG); 40 | #endif 41 | } 42 | 43 | void debug_led_off() { 44 | #if LED_DBG 45 | gpio_pin_output(LED_DBG); 46 | gpio_pin_clr(LED_DBG); 47 | #endif 48 | } 49 | 50 | -------------------------------------------------------------------------------- /components/lua_rtos/sys/delay.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, delay functions 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include "luartos.h" 31 | 32 | #include "freertos/FreeRTOS.h" 33 | #include "esp_attr.h" 34 | 35 | #include 36 | 37 | void IRAM_ATTR delay(unsigned int msec) { 38 | unsigned int tWait, tStart; 39 | tWait = (CPU_HZ / (1000 * (CPU_HZ / CORE_TIMER_HZ))) * msec; 40 | tStart = xthal_get_ccount(); 41 | while((xthal_get_ccount() - tStart) < tWait); 42 | } 43 | 44 | void IRAM_ATTR udelay(unsigned int usec) { 45 | unsigned int tWait, tStart; 46 | tWait = (CPU_HZ / (1000000 * (CPU_HZ / CORE_TIMER_HZ))) * usec; 47 | tStart = xthal_get_ccount(); 48 | while((xthal_get_ccount() - tStart) < tWait); 49 | } 50 | -------------------------------------------------------------------------------- /components/lua_rtos/sys/delay.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, delay functions 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef _SYS_DELAY_H_ 31 | #define _SYS_DELAY_H_ 32 | 33 | extern unsigned int _read_core_timer(void); 34 | 35 | void delay(unsigned int msec); 36 | void udelay(unsigned int usec); 37 | 38 | #endif /* !_SYS_DELAY_H_ */ 39 | -------------------------------------------------------------------------------- /components/lua_rtos/sys/list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, list data structure 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef _LIST_H 31 | #define _LIST_H 32 | 33 | #include 34 | #include 35 | 36 | struct list { 37 | struct mtx mutex; 38 | struct list_index *index; 39 | struct list_index *free; 40 | uint8_t indexes; 41 | uint8_t first_index; 42 | }; 43 | 44 | struct list_index { 45 | void *item; 46 | uint8_t index; 47 | uint8_t deleted; 48 | struct list_index *next; 49 | }; 50 | 51 | void list_init(struct list *list, int first_index); 52 | int list_add(struct list *list, void *item, int *item_index); 53 | int list_get(struct list *list, int index, void **item); 54 | int list_remove(struct list *list, int index, int destroy); 55 | int list_first(struct list *list); 56 | int list_next(struct list *list, int index); 57 | void list_destroy(struct list *list, int items); 58 | 59 | #endif /* LIST_H */ 60 | 61 | -------------------------------------------------------------------------------- /components/lua_rtos/sys/mount.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, minimal mount capabilities. Mount are only allowed in 3 | * the default root's directory. 4 | * 5 | * Copyright (C) 2015 - 2017 6 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 7 | * 8 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 9 | * 10 | * All rights reserved. 11 | * 12 | * Permission to use, copy, modify, and distribute this software 13 | * and its documentation for any purpose and without fee is hereby 14 | * granted, provided that the above copyright notice appear in all 15 | * copies and that both that the copyright notice and this 16 | * permission notice and warranty disclaimer appear in supporting 17 | * documentation, and that the name of the author not be used in 18 | * advertising or publicity pertaining to distribution of the 19 | * software without specific, written prior permission. 20 | * 21 | * The author disclaim all warranties with regard to this 22 | * software, including all implied warranties of merchantability 23 | * and fitness. In no event shall the author be liable for any 24 | * special, indirect or consequential damages or any damages 25 | * whatsoever resulting from loss of use, data or profits, whether 26 | * in an action of contract, negligence or other tortious action, 27 | * arising out of or in connection with the use or performance of 28 | * this software. 29 | */ 30 | 31 | #ifndef _SYSCALLS_MOUNT_H 32 | #define _SYSCALLS_MOUNT_H 33 | 34 | char *mount_normalize_path(const char *path); 35 | char *mount_readdir(const char *dev, const char*path, int idx, char *buf); 36 | const char *mount_device(const char *path); 37 | const char *mount_path(const char *path); 38 | void mount_set_mounted(const char *device, unsigned int mounted); 39 | int mount_is_mounted(const char *device); 40 | const char *mount_default_device(); 41 | char *mount_resolve_to_physical(const char *path); 42 | char *mount_resolve_to_logical(const char *path); 43 | const char *mount_get_device_from_path(const char *path, char **rpath); 44 | const char *mount_get_mount_from_path(const char *path, char **rpath); 45 | int mount_is_mounted(const char *device); 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /components/lua_rtos/sys/panic.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, panic functions 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include 31 | 32 | void panic(char *str) { 33 | printf("%s\n", str); 34 | for(;;) { 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /components/lua_rtos/sys/panic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, panic functions 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef _SYS_PANIC_H_ 31 | #define _SYS_PANIC_H_ 32 | 33 | void panic(char *str); 34 | 35 | #endif /* !_SYS_PANIC_H_ */ 36 | -------------------------------------------------------------------------------- /components/lua_rtos/sys/preprocessor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, some useful preprocessor macros 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef _PREPROCESSOR_H 31 | #define _PREPROCESSOR_H 32 | 33 | // Macros for concatenate 2 tokens 34 | #define PREP_PASTER(x,y) x##y 35 | #define PREP_EVALUATOR(x,y) PREP_PASTER(x,y) 36 | #define PREP_CONCAT(x,y) PREP_EVALUATOR(x,y) 37 | 38 | // Macros for stringify a token 39 | #define PREP_TOSTRING_PASTER(x) #x 40 | #define PREP_TOSTRING_EVALUATOR(x) PREP_TOSTRING_PASTER(x) 41 | #define PREP_TOSTRING(x) PREP_TOSTRING_EVALUATOR(x) 42 | 43 | #endif // _PREPROCESSOR_H 44 | -------------------------------------------------------------------------------- /components/lua_rtos/sys/semaphore.h: -------------------------------------------------------------------------------- 1 | #include "freertos/FreeRTOS.h" 2 | #include "freertos/semphr.h" 3 | 4 | typedef xSemaphoreHandle sem_t; 5 | -------------------------------------------------------------------------------- /components/lua_rtos/sys/signal.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, minimal signal implementation 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include 31 | #include 32 | 33 | void _signal_init() { 34 | } 35 | 36 | sig_t signal(int s, sig_t h) { 37 | return _pthread_signal(s, h); 38 | } 39 | -------------------------------------------------------------------------------- /components/lua_rtos/sys/sleep.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, sleep functions 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include "freertos/FreeRTOS.h" 31 | #include "freertos/task.h" 32 | 33 | #include 34 | 35 | unsigned sleep(unsigned int secs) { 36 | vTaskDelay( (secs * 1000) / ((TickType_t) 1000 / configTICK_RATE_HZ)); 37 | 38 | return 0; 39 | } 40 | 41 | int usleep(useconds_t usec) { 42 | vTaskDelay(usec / ((TickType_t) 1000000 / configTICK_RATE_HZ)); 43 | 44 | return 0; 45 | } 46 | -------------------------------------------------------------------------------- /components/lua_rtos/sys/sleep.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, sleep functions 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef _SYS_SLEEP_H_ 31 | #define _SYS_SLEEP_H_ 32 | 33 | #include 34 | 35 | unsigned sleep(unsigned int secs); 36 | int usleep(useconds_t usec); 37 | 38 | #endif /* !_SYS_SLEEP_H_ */ 39 | -------------------------------------------------------------------------------- /components/lua_rtos/sys/status.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, LuaOS status management 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include 31 | 32 | uint32_t LuaOS_status[] = {0}; 33 | 34 | void IRAM_ATTR status_set(uint16_t flag) { 35 | LuaOS_status[(flag >> 8)] |= (1 << (flag & 0x00ff)); 36 | } 37 | 38 | void IRAM_ATTR status_clear(uint16_t flag) { 39 | LuaOS_status[(flag >> 8)] &= ~(1 << (flag & 0x00ff)); 40 | } 41 | 42 | int IRAM_ATTR status_get(uint16_t flag) { 43 | int value; 44 | 45 | value = (LuaOS_status[(flag >> 8)] & (1 << (flag & 0x00ff))); 46 | 47 | return value; 48 | } 49 | 50 | -------------------------------------------------------------------------------- /components/lua_rtos/syscalls/__wrap__calloc_r.c: -------------------------------------------------------------------------------- 1 | #include "freertos/adds.h" 2 | #include "freertos/task.h" 3 | 4 | #include "esp_attr.h" 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | #include 16 | 17 | extern int __real__calloc_r(struct _reent *r, size_t nmemb, size_t size); 18 | 19 | int IRAM_ATTR __wrap__calloc_r(struct _reent *r, size_t nmemb, size_t size) { 20 | int res; 21 | 22 | if (!(res = __real__calloc_r(r, nmemb,size))) { 23 | luaC_fullgc(pvGetLuaState(), 1); 24 | vTaskDelay(1 / portTICK_PERIOD_MS); 25 | luaC_fullgc(pvGetLuaState(), 1); 26 | vTaskDelay(1 / portTICK_PERIOD_MS); 27 | res = __real__calloc_r(r, nmemb, size); 28 | } 29 | 30 | return res; 31 | } 32 | -------------------------------------------------------------------------------- /components/lua_rtos/syscalls/__wrap__malloc_r.c: -------------------------------------------------------------------------------- 1 | #include "freertos/adds.h" 2 | #include "freertos/task.h" 3 | 4 | #include "esp_attr.h" 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | #include 16 | 17 | extern int __real__malloc_r(struct _reent *r, size_t size); 18 | 19 | int IRAM_ATTR __wrap__malloc_r(struct _reent *r, size_t size) { 20 | int res; 21 | 22 | if (!(res = __real__malloc_r(r, size))) { 23 | luaC_fullgc(pvGetLuaState(), 1); 24 | vTaskDelay(1 / portTICK_PERIOD_MS); 25 | luaC_fullgc(pvGetLuaState(), 1); 26 | vTaskDelay(1 / portTICK_PERIOD_MS); 27 | res = __real__malloc_r(r, size); 28 | } 29 | 30 | return res; 31 | } 32 | -------------------------------------------------------------------------------- /components/lua_rtos/syscalls/__wrap__open_r.c: -------------------------------------------------------------------------------- 1 | #include "esp_attr.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | extern int __real__open_r(struct _reent *r, const char *path, int flags, int mode); 13 | 14 | int IRAM_ATTR __wrap__open_r(struct _reent *r, const char *path, int flags, int mode) { 15 | char *ppath; 16 | int res; 17 | 18 | if ((strncmp(path,"/dev/uart/",10) == 0) || (strncmp(path,"/dev/tty/",9) == 0) || (strncmp(path,"/dev/socket/",12) == 0)) { 19 | return __real__open_r(r, path, flags, mode); 20 | } else { 21 | ppath = mount_resolve_to_physical(path); 22 | res = __real__open_r(r, ppath, flags, mode); 23 | free(ppath); 24 | return res; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /components/lua_rtos/syscalls/__wrap__realloc_r.c: -------------------------------------------------------------------------------- 1 | #include "freertos/adds.h" 2 | #include "freertos/task.h" 3 | 4 | #include "esp_attr.h" 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | #include 16 | 17 | extern int __real__realloc_r(struct _reent *r, void *ptr, size_t size); 18 | 19 | int IRAM_ATTR __wrap__realloc_r(struct _reent *r, void *ptr, size_t size) { 20 | int res; 21 | 22 | if (!(res = __real__realloc_r(r, ptr,size))) { 23 | luaC_fullgc(pvGetLuaState(), 1); 24 | vTaskDelay(1 / portTICK_PERIOD_MS); 25 | luaC_fullgc(pvGetLuaState(), 1); 26 | vTaskDelay(1 / portTICK_PERIOD_MS); 27 | res = __real__realloc_r(r, ptr, size); 28 | } 29 | 30 | return res; 31 | } 32 | -------------------------------------------------------------------------------- /components/lua_rtos/syscalls/__wrap__rename_r.c: -------------------------------------------------------------------------------- 1 | #include "esp_attr.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | extern int __real__rename_r(struct _reent *r, const char *src, const char *dst); 12 | 13 | int IRAM_ATTR __wrap__rename_r(struct _reent *r, const char *src, const char *dst) { 14 | char *ppath_src; 15 | char *ppath_dst; 16 | int res; 17 | 18 | ppath_src = mount_resolve_to_physical(src); 19 | ppath_dst = mount_resolve_to_physical(dst); 20 | 21 | res = __real__rename_r(r, ppath_src, ppath_dst); 22 | 23 | free(ppath_src); 24 | free(ppath_dst); 25 | 26 | return res; 27 | } 28 | -------------------------------------------------------------------------------- /components/lua_rtos/syscalls/__wrap__stat_r.c: -------------------------------------------------------------------------------- 1 | #include "esp_attr.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | extern int __real__stat_r(struct _reent *r, const char *path, int flags, int mode); 13 | 14 | int IRAM_ATTR __wrap__stat_r(struct _reent *r, const char *path, int flags, int mode) { 15 | char *ppath; 16 | int res; 17 | 18 | if ((strncmp(path,"/dev/uart/",10) == 0) || (strncmp(path,"/dev/tty/",9) == 0) || (strncmp(path,"/dev/socket/",12) == 0)) { 19 | return __real__stat_r(r, path, flags, mode); 20 | } else { 21 | ppath = mount_resolve_to_physical(path); 22 | res = __real__stat_r(r, ppath, flags, mode); 23 | free(ppath); 24 | return res; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /components/lua_rtos/syscalls/__wrap__unlink_r.c: -------------------------------------------------------------------------------- 1 | #include "esp_attr.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | extern int __real__unlink_r(struct _reent *r, const char *path); 12 | 13 | int IRAM_ATTR __wrap__unlink_r(struct _reent *r, const char *path) { 14 | char *ppath; 15 | int res; 16 | 17 | ppath = mount_resolve_to_physical(path); 18 | res = __real__unlink_r(r, ppath); 19 | 20 | free(ppath); 21 | 22 | return res; 23 | } 24 | -------------------------------------------------------------------------------- /components/lua_rtos/syscalls/__wrap_mkdir.c: -------------------------------------------------------------------------------- 1 | #include "esp_attr.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | extern int __real_mkdir(const char* name, mode_t mode); 13 | 14 | int __wrap_mkdir(const char* name, mode_t mode) { 15 | char *ppath; 16 | int res; 17 | 18 | ppath = mount_resolve_to_physical(name); 19 | res = __real_mkdir(ppath, mode); 20 | 21 | free(ppath); 22 | 23 | return res; 24 | } 25 | -------------------------------------------------------------------------------- /components/lua_rtos/syscalls/__wrap_opendir.c: -------------------------------------------------------------------------------- 1 | #include "esp_attr.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | #include 13 | 14 | DIR* __real_opendir(const char* name); 15 | 16 | DIR* __wrap_opendir(const char* name) { 17 | char *ppath; 18 | DIR *dir; 19 | 20 | ppath = mount_resolve_to_physical(name); 21 | dir = __real_opendir(ppath); 22 | 23 | free(ppath); 24 | 25 | return dir; 26 | } 27 | -------------------------------------------------------------------------------- /components/lua_rtos/syscalls/__wrap_readdir.c: -------------------------------------------------------------------------------- 1 | #include "esp_attr.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | #include 13 | 14 | DIR* __real_readdir(const char* name); 15 | 16 | DIR* __wrap_readdir(const char* name) { 17 | char *ppath; 18 | DIR *dir; 19 | 20 | ppath = mount_resolve_to_physical(name); 21 | dir = __real_readdir(ppath); 22 | 23 | free(ppath); 24 | 25 | return dir; 26 | } 27 | -------------------------------------------------------------------------------- /components/lua_rtos/unix/getcwd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, getcwd implementation 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #include 39 | 40 | extern char currdir[]; 41 | 42 | char *getcwd(char *pt, size_t size) { 43 | *pt = '\0'; 44 | 45 | if (*currdir != '/') { 46 | strcat(pt, "/"); 47 | } 48 | 49 | strcat(pt, currdir); 50 | 51 | return pt; 52 | } 53 | 54 | char *realpath(const char *path, char *resolved) { 55 | char *fpath; // Full path 56 | 57 | fpath = mount_resolve_to_physical(path); 58 | 59 | strcpy(resolved,fpath); 60 | 61 | free(fpath); 62 | 63 | return resolved; 64 | } 65 | -------------------------------------------------------------------------------- /components/lua_rtos/vfs/fat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, FAT vfs operations 3 | * 4 | * Copyright (C) 2015 - 2017 LoBo 5 | * 6 | * Author: LoBo (loboris@gmail.com / https://github.com/loboris) 7 | * 8 | * All rights reserved. 9 | * 10 | * Permission to use, copy, modify, and distribute this software 11 | * and its documentation for any purpose and without fee is hereby 12 | * granted, provided that the above copyright notice appear in all 13 | * copies and that both that the copyright notice and this 14 | * permission notice and warranty disclaimer appear in supporting 15 | * documentation, and that the name of the author not be used in 16 | * advertising or publicity pertaining to distribution of the 17 | * software without specific, written prior permission. 18 | * 19 | * The author disclaim all warranties with regard to this 20 | * software, including all implied warranties of merchantability 21 | * and fitness. In no event shall the author be liable for any 22 | * special, indirect or consequential damages or any damages 23 | * whatsoever resulting from loss of use, data or profits, whether 24 | * in an action of contract, negligence or other tortious action, 25 | * arising out of or in connection with the use or performance of 26 | * this software. 27 | */ 28 | 29 | void mount_fatfs(); 30 | void unmount_fatfs(); 31 | -------------------------------------------------------------------------------- /components/lua_rtos/vfs/vfs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, vfs register functions 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | void vfs_fat_register(); 31 | void vfs_net_register(); 32 | void vfs_spiffs_register(); 33 | void vfs_tty_register(); 34 | -------------------------------------------------------------------------------- /components/mkspiffs/.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | addons: 3 | apt: 4 | sources: 5 | - ubuntu-toolchain-r-test 6 | packages: 7 | - g++-4.8 8 | script: 9 | - export CXX="g++-4.8" CC="gcc-4.8" 10 | - make dist 11 | notifications: 12 | email: 13 | recipients: 14 | - ivan@esp8266.com 15 | on_success: change 16 | on_failure: always 17 | deploy: 18 | provider: releases 19 | api_key: 20 | secure: k/DDoCfLXIct8TcGjekKm5CAoTL6Wy6LXhI74Ssgc8VSbjJQ1crO2J4V5HnQw7QplgAXwqjkoAUkzEJiz34wqBaAv0w9o8+5jPwCP6rMQ/VEvbn1MPI52KIFbYqKxmXe5J24B00BttbGc773ldXPnvmv+qPWWcXDTpcosni2laBt3z8bxCGVwkQ7nuQUaAelzs21wQuhjmKQ6F1dgNN5XhdJ5qgFYYM8cwiigvcqIaCwLMcrOs7gj22TS242pzp38etWhfxUbqUKejWgOH4qYeU3Tf5gsu4WV0otbqXYMvV18gVSoAiMnodDfYJUNHlfelCAEqebvECrIvvE8D0syuVYz6fh2/BrxZ6HeiYj1CXILghOjPUZZZ7/chKglWnA1vL+6Uxn5LtyTJ5gbgMYXvKQUXrRVZ3Zd9xrmv/YaMnGq+6BDBkS30aXpSK2X0HvW9/6JyQ9L1sjnKdOzDmagvikHm2rrPXBRMMfYTt4nucgUBWqJqyFe0uGva/n8TG5RzOzdOgRxFx/lF8XudtR4Z4gUBUFpve/meVHVVK82+cxzfN97aFdxvBzyGq18EDjOEpDi7k7mZjXUycvD8UZ7o12sxJ0Zr6/9esiFUsaqyE+2Vi6bMbgEHGx7hfWbdfREnpOtjFLH+u5mAPIqOh89a/UJ6SbYm0cON+ewTMUkJ8= 21 | file: mkspiffs-$TRAVIS_TAG-linux64.tar.gz 22 | on: 23 | repo: igrr/mkspiffs 24 | tags: true 25 | -------------------------------------------------------------------------------- /components/mkspiffs/Makefile.projbuild: -------------------------------------------------------------------------------- 1 | MKSPIFFS_COMPONENT_PATH := $(COMPONENT_PATH) 2 | MKSPIFFS_BUILD_DIR=$(abspath $(MKSPIFFS_COMPONENT_PATH)/mkspiffs) 3 | 4 | # Custom recursive make for mkspiffs sub-project 5 | MKSPIFFS_MAKE=+$(MAKE) -C $(MKSPIFFS_COMPONENT_PATH)/src 6 | 7 | .PHONY: mkspiffs clean 8 | 9 | mkspiffs: $(SDKCONFIG_MAKEFILE) 10 | $(MKSPIFFS_MAKE) all 11 | 12 | clean: $(SDKCONFIG_MAKEFILE) 13 | $(MKSPIFFS_MAKE) clean 14 | 15 | -------------------------------------------------------------------------------- /components/mkspiffs/src/README.md: -------------------------------------------------------------------------------- 1 | # mkspiffs 2 | Tool to build and unpack [SPIFFS](https://github.com/pellepl/spiffs) images. 3 | 4 | 5 | ## Usage 6 | 7 | ``` 8 | 9 | mkspiffs {-c |-u |-l|-i} [-d <0-5>] [-b ] 10 | [-p ] [-s ] [--] [--version] [-h] 11 | 12 | 13 | 14 | Where: 15 | 16 | -c , --create 17 | (OR required) create spiffs image from a directory 18 | -- OR -- 19 | -u , --unpack 20 | (OR required) unpack spiffs image to a directory 21 | -- OR -- 22 | -l, --list 23 | (OR required) list files in spiffs image 24 | -- OR -- 25 | -i, --visualize 26 | (OR required) visualize spiffs image 27 | 28 | 29 | -d <0-5>, --debug <0-5> 30 | Debug level. 0 means no debug output. 31 | 32 | -b , --block 33 | fs block size, in bytes 34 | 35 | -p , --page 36 | fs page size, in bytes 37 | 38 | -s , --size 39 | fs image size, in bytes 40 | 41 | --, --ignore_rest 42 | Ignores the rest of the labeled arguments following this flag. 43 | 44 | --version 45 | Displays version information and exits. 46 | 47 | -h, --help 48 | Displays usage information and exits. 49 | 50 | 51 | (required) spiffs image file 52 | 53 | 54 | ``` 55 | ## Build 56 | 57 | You need gcc (≥4.8) or clang(≥600.0.57), and make. On Windows, use MinGW. 58 | 59 | Run: 60 | ```bash 61 | $ make dist 62 | ``` 63 | 64 | ### Build status 65 | 66 | Linux | Windows 67 | ------|------- 68 | [![Linux build status](http://img.shields.io/travis/igrr/mkspiffs.svg)](https://travis-ci.org/igrr/mkspiffs) | [![Windows build status](http://img.shields.io/appveyor/ci/igrr/mkspiffs.svg)](https://ci.appveyor.com/project/igrr/mkspiffs) 69 | 70 | 71 | ## License 72 | 73 | MIT 74 | 75 | ## To do 76 | 77 | - [ ] Add more debug output and print SPIFFS debug output 78 | - [ ] Error handling 79 | - [ ] Determine the image size automatically when opening a file 80 | - [ ] Code cleanup 81 | -------------------------------------------------------------------------------- /components/mkspiffs/src/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 0.0.{build} 2 | 3 | platform: 4 | - x86 5 | 6 | skip_commits: 7 | message: /\[ci skip\]/ 8 | 9 | matrix: 10 | fast_finish: true 11 | 12 | build_script: 13 | - SET PATH=C:\MinGW\bin;C:\MinGW\msys\1.0\bin;%PATH% 14 | - make dist 15 | 16 | artifacts: 17 | - path: '*.zip' 18 | 19 | deploy: 20 | release: $(PRODUCT_VERSION) 21 | provider: GitHub 22 | auth_token: 23 | secure: 'PGg5fnoBpP1Omzr6f3KIYDiD8J30rretQjSl/MITRpzvSCmN88kM6VDMz1TBGZTA' 24 | artifact: /.*\.zip/ 25 | draft: true 26 | prerelease: false 27 | on: 28 | appveyor_repo_tag: true 29 | -------------------------------------------------------------------------------- /components/mkspiffs/src/spiffs/esp_spiffs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, write syscall implementation 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef __ESP_SPIFFS_H__ 31 | #define __ESP_SPIFFS_H__ 32 | 33 | #include "spiffs.h" 34 | 35 | s32_t esp32_spi_flash_read(u32_t addr, u32_t size, u8_t *dst); 36 | s32_t esp32_spi_flash_write(u32_t addr, u32_t size, const u8_t *src); 37 | s32_t esp32_spi_flash_erase(u32_t addr, u32_t size); 38 | 39 | #define low_spiffs_read (spiffs_read *)esp32_spi_flash_read 40 | #define low_spiffs_write (spiffs_write *)esp32_spi_flash_write 41 | #define low_spiffs_erase (spiffs_erase *)esp32_spi_flash_erase 42 | 43 | #endif // __ESP_SPIFFS_H__ 44 | -------------------------------------------------------------------------------- /components/mkspiffs/src/tclap/COPYING: -------------------------------------------------------------------------------- 1 | 2 | 3 | Copyright (c) 2003 Michael E. Smoot 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, 9 | publish, distribute, sublicense, and/or sell copies of the Software, 10 | and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 21 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 22 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | 25 | 26 | -------------------------------------------------------------------------------- /components/mkspiffs/src/tclap/CmdLineOutput.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /****************************************************************************** 4 | * 5 | * file: CmdLineOutput.h 6 | * 7 | * Copyright (c) 2004, Michael E. Smoot 8 | * All rights reverved. 9 | * 10 | * See the file COPYING in the top directory of this distribution for 11 | * more information. 12 | * 13 | * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 14 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | * DEALINGS IN THE SOFTWARE. 20 | * 21 | *****************************************************************************/ 22 | 23 | #ifndef TCLAP_CMDLINEOUTPUT_H 24 | #define TCLAP_CMDLINEOUTPUT_H 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | namespace TCLAP { 34 | 35 | class CmdLineInterface; 36 | class ArgException; 37 | 38 | /** 39 | * The interface that any output object must implement. 40 | */ 41 | class CmdLineOutput 42 | { 43 | 44 | public: 45 | 46 | /** 47 | * Virtual destructor. 48 | */ 49 | virtual ~CmdLineOutput() {} 50 | 51 | /** 52 | * Generates some sort of output for the USAGE. 53 | * \param c - The CmdLine object the output is generated for. 54 | */ 55 | virtual void usage(CmdLineInterface& c)=0; 56 | 57 | /** 58 | * Generates some sort of output for the version. 59 | * \param c - The CmdLine object the output is generated for. 60 | */ 61 | virtual void version(CmdLineInterface& c)=0; 62 | 63 | /** 64 | * Generates some sort of output for a failure. 65 | * \param c - The CmdLine object the output is generated for. 66 | * \param e - The ArgException that caused the failure. 67 | */ 68 | virtual void failure( CmdLineInterface& c, 69 | ArgException& e )=0; 70 | 71 | }; 72 | 73 | } //namespace TCLAP 74 | #endif 75 | -------------------------------------------------------------------------------- /components/mkspiffs/src/tclap/Constraint.h: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * 4 | * file: Constraint.h 5 | * 6 | * Copyright (c) 2005, Michael E. Smoot 7 | * All rights reverved. 8 | * 9 | * See the file COPYING in the top directory of this distribution for 10 | * more information. 11 | * 12 | * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 13 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 15 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 18 | * DEALINGS IN THE SOFTWARE. 19 | * 20 | *****************************************************************************/ 21 | 22 | #ifndef TCLAP_CONSTRAINT_H 23 | #define TCLAP_CONSTRAINT_H 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | namespace TCLAP { 33 | 34 | /** 35 | * The interface that defines the interaction between the Arg and Constraint. 36 | */ 37 | template 38 | class Constraint 39 | { 40 | 41 | public: 42 | /** 43 | * Returns a description of the Constraint. 44 | */ 45 | virtual std::string description() const =0; 46 | 47 | /** 48 | * Returns the short ID for the Constraint. 49 | */ 50 | virtual std::string shortID() const =0; 51 | 52 | /** 53 | * The method used to verify that the value parsed from the command 54 | * line meets the constraint. 55 | * \param value - The value that will be checked. 56 | */ 57 | virtual bool check(const T& value) const =0; 58 | 59 | /** 60 | * Destructor. 61 | * Silences warnings about Constraint being a base class with virtual 62 | * functions but without a virtual destructor. 63 | */ 64 | virtual ~Constraint() { ; } 65 | }; 66 | 67 | } //namespace TCLAP 68 | #endif 69 | -------------------------------------------------------------------------------- /components/mkspiffs/src/tclap/HelpVisitor.h: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * 4 | * file: HelpVisitor.h 5 | * 6 | * Copyright (c) 2003, Michael E. Smoot . 7 | * All rights reverved. 8 | * 9 | * See the file COPYING in the top directory of this distribution for 10 | * more information. 11 | * 12 | * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 13 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 15 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 18 | * DEALINGS IN THE SOFTWARE. 19 | * 20 | *****************************************************************************/ 21 | 22 | #ifndef TCLAP_HELP_VISITOR_H 23 | #define TCLAP_HELP_VISITOR_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | namespace TCLAP { 30 | 31 | /** 32 | * A Visitor object that calls the usage method of the given CmdLineOutput 33 | * object for the specified CmdLine object. 34 | */ 35 | class HelpVisitor: public Visitor 36 | { 37 | private: 38 | /** 39 | * Prevent accidental copying. 40 | */ 41 | HelpVisitor(const HelpVisitor& rhs); 42 | HelpVisitor& operator=(const HelpVisitor& rhs); 43 | 44 | protected: 45 | 46 | /** 47 | * The CmdLine the output will be generated for. 48 | */ 49 | CmdLineInterface* _cmd; 50 | 51 | /** 52 | * The output object. 53 | */ 54 | CmdLineOutput** _out; 55 | 56 | public: 57 | 58 | /** 59 | * Constructor. 60 | * \param cmd - The CmdLine the output will be generated for. 61 | * \param out - The type of output. 62 | */ 63 | HelpVisitor(CmdLineInterface* cmd, CmdLineOutput** out) 64 | : Visitor(), _cmd( cmd ), _out( out ) { } 65 | 66 | /** 67 | * Calls the usage method of the CmdLineOutput for the 68 | * specified CmdLine. 69 | */ 70 | void visit() { (*_out)->usage(*_cmd); throw ExitException(0); } 71 | 72 | }; 73 | 74 | } 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /components/mkspiffs/src/tclap/IgnoreRestVisitor.h: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * 4 | * file: IgnoreRestVisitor.h 5 | * 6 | * Copyright (c) 2003, Michael E. Smoot . 7 | * All rights reverved. 8 | * 9 | * See the file COPYING in the top directory of this distribution for 10 | * more information. 11 | * 12 | * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 13 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 15 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 18 | * DEALINGS IN THE SOFTWARE. 19 | * 20 | *****************************************************************************/ 21 | 22 | 23 | #ifndef TCLAP_IGNORE_REST_VISITOR_H 24 | #define TCLAP_IGNORE_REST_VISITOR_H 25 | 26 | #include 27 | #include 28 | 29 | namespace TCLAP { 30 | 31 | /** 32 | * A Vistor that tells the CmdLine to begin ignoring arguments after 33 | * this one is parsed. 34 | */ 35 | class IgnoreRestVisitor: public Visitor 36 | { 37 | public: 38 | 39 | /** 40 | * Constructor. 41 | */ 42 | IgnoreRestVisitor() : Visitor() {} 43 | 44 | /** 45 | * Sets Arg::_ignoreRest. 46 | */ 47 | void visit() { Arg::beginIgnoring(); } 48 | }; 49 | 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /components/mkspiffs/src/tclap/OptionalUnlabeledTracker.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /****************************************************************************** 4 | * 5 | * file: OptionalUnlabeledTracker.h 6 | * 7 | * Copyright (c) 2005, Michael E. Smoot . 8 | * All rights reverved. 9 | * 10 | * See the file COPYING in the top directory of this distribution for 11 | * more information. 12 | * 13 | * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 14 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | * DEALINGS IN THE SOFTWARE. 20 | * 21 | *****************************************************************************/ 22 | 23 | 24 | #ifndef TCLAP_OPTIONAL_UNLABELED_TRACKER_H 25 | #define TCLAP_OPTIONAL_UNLABELED_TRACKER_H 26 | 27 | #include 28 | 29 | namespace TCLAP { 30 | 31 | class OptionalUnlabeledTracker 32 | { 33 | 34 | public: 35 | 36 | static void check( bool req, const std::string& argName ); 37 | 38 | static void gotOptional() { alreadyOptionalRef() = true; } 39 | 40 | static bool& alreadyOptional() { return alreadyOptionalRef(); } 41 | 42 | private: 43 | 44 | static bool& alreadyOptionalRef() { static bool ct = false; return ct; } 45 | }; 46 | 47 | 48 | inline void OptionalUnlabeledTracker::check( bool req, const std::string& argName ) 49 | { 50 | if ( OptionalUnlabeledTracker::alreadyOptional() ) 51 | throw( SpecificationException( 52 | "You can't specify ANY Unlabeled Arg following an optional Unlabeled Arg", 53 | argName ) ); 54 | 55 | if ( !req ) 56 | OptionalUnlabeledTracker::gotOptional(); 57 | } 58 | 59 | 60 | } // namespace TCLAP 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /components/mkspiffs/src/tclap/Visitor.h: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * 4 | * file: Visitor.h 5 | * 6 | * Copyright (c) 2003, Michael E. Smoot . 7 | * All rights reverved. 8 | * 9 | * See the file COPYING in the top directory of this distribution for 10 | * more information. 11 | * 12 | * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 13 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 15 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 18 | * DEALINGS IN THE SOFTWARE. 19 | * 20 | *****************************************************************************/ 21 | 22 | 23 | #ifndef TCLAP_VISITOR_H 24 | #define TCLAP_VISITOR_H 25 | 26 | namespace TCLAP { 27 | 28 | /** 29 | * A base class that defines the interface for visitors. 30 | */ 31 | class Visitor 32 | { 33 | public: 34 | 35 | /** 36 | * Constructor. Does nothing. 37 | */ 38 | Visitor() { } 39 | 40 | /** 41 | * Destructor. Does nothing. 42 | */ 43 | virtual ~Visitor() { } 44 | 45 | /** 46 | * Does nothing. Should be overridden by child. 47 | */ 48 | virtual void visit() { } 49 | }; 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /components/mqtt/Clients.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - add SSL support 16 | *******************************************************************************/ 17 | 18 | /** 19 | * @file 20 | * \brief functions which apply to client structures 21 | * */ 22 | 23 | 24 | #include "Clients.h" 25 | 26 | #include 27 | #include 28 | 29 | 30 | /** 31 | * List callback function for comparing clients by clientid 32 | * @param a first integer value 33 | * @param b second integer value 34 | * @return boolean indicating whether a and b are equal 35 | */ 36 | int clientIDCompare(void* a, void* b) 37 | { 38 | Clients* client = (Clients*)a; 39 | /*printf("comparing clientdIDs %s with %s\n", client->clientID, (char*)b);*/ 40 | return strcmp(client->clientID, (char*)b) == 0; 41 | } 42 | 43 | 44 | /** 45 | * List callback function for comparing clients by socket 46 | * @param a first integer value 47 | * @param b second integer value 48 | * @return boolean indicating whether a and b are equal 49 | */ 50 | int clientSocketCompare(void* a, void* b) 51 | { 52 | Clients* client = (Clients*)a; 53 | /*printf("comparing %d with %d\n", (char*)a, (char*)b); */ 54 | return client->net.socket == *(int*)b; 55 | } 56 | -------------------------------------------------------------------------------- /components/mqtt/Heap.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /components/mqtt/Log.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - updates for the async client 16 | *******************************************************************************/ 17 | 18 | /* 19 | * This file has adapted to Lua RTOS syslog 20 | * 21 | */ 22 | 23 | #if !defined(LOG_H) 24 | #define LOG_H 25 | 26 | #include 27 | 28 | #define TRACE_MAX 8 29 | #define TRACE_MINIMUM 8 30 | #define TRACE_PROTOCOL 10 31 | #define LOG_PROTOCOL 10 32 | 33 | #define TRACE_MIN LOG_INFO 34 | #define LOG_ERROR LOG_ERR 35 | #define LOG_SEVERE LOG_CRIT 36 | #define LOG_FATAL LOG_CRIT 37 | 38 | #define Log_initialize() 39 | #define Log_terminate() 40 | 41 | #define Log(level, msgno, fmt, ...) \ 42 | do { \ 43 | if (msgno < 0) { \ 44 | syslog(level, fmt, ##__VA_ARGS__); \ 45 | } else { \ 46 | if ((level == TRACE_PROTOCOL) || (level == LOG_PROTOCOL)) { \ 47 | syslog(LOG_DEBUG, (const char *)Messages_get(msgno, level), ##__VA_ARGS__); \ 48 | } \ 49 | } \ 50 | } while (0) 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /components/mqtt/MQTTPacketOut.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 support 17 | *******************************************************************************/ 18 | 19 | #if !defined(MQTTPACKETOUT_H) 20 | #define MQTTPACKETOUT_H 21 | 22 | #include "MQTTPacket.h" 23 | 24 | int MQTTPacket_send_connect(Clients* client, int MQTTVersion); 25 | void* MQTTPacket_connack(unsigned char aHeader, char* data, size_t datalen); 26 | 27 | int MQTTPacket_send_pingreq(networkHandles* net, const char* clientID); 28 | 29 | int MQTTPacket_send_subscribe(List* topics, List* qoss, int msgid, int dup, networkHandles* net, const char* clientID); 30 | void* MQTTPacket_suback(unsigned char aHeader, char* data, size_t datalen); 31 | 32 | int MQTTPacket_send_unsubscribe(List* topics, int msgid, int dup, networkHandles* net, const char* clientID); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /components/mqtt/MQTTProtocol.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - MQTT 3.1.1 updates 16 | *******************************************************************************/ 17 | 18 | #if !defined(MQTTPROTOCOL_H) 19 | #define MQTTPROTOCOL_H 20 | 21 | #include "LinkedList.h" 22 | #include "MQTTPacket.h" 23 | #include "Clients.h" 24 | 25 | #define MAX_MSG_ID 65535 26 | #define MAX_CLIENTID_LEN 65535 27 | 28 | typedef struct 29 | { 30 | int socket; 31 | Publications* p; 32 | } pending_write; 33 | 34 | 35 | typedef struct 36 | { 37 | List publications; 38 | unsigned int msgs_received; 39 | unsigned int msgs_sent; 40 | List pending_writes; /* for qos 0 writes not complete */ 41 | } MQTTProtocol; 42 | 43 | 44 | #include "MQTTProtocolOut.h" 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /components/mqtt/MQTTProtocolClient.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 updates 17 | * Rong Xiang, Ian Craggs - C++ compatibility 18 | *******************************************************************************/ 19 | 20 | #if !defined(MQTTPROTOCOLCLIENT_H) 21 | #define MQTTPROTOCOLCLIENT_H 22 | 23 | #include "LinkedList.h" 24 | #include "MQTTPacket.h" 25 | #include "Log.h" 26 | #include "MQTTProtocol.h" 27 | #include "Messages.h" 28 | 29 | #define MAX_MSG_ID 65535 30 | #define MAX_CLIENTID_LEN 65535 31 | 32 | int MQTTProtocol_startPublish(Clients* pubclient, Publish* publish, int qos, int retained, Messages** m); 33 | Messages* MQTTProtocol_createMessage(Publish* publish, Messages** mm, int qos, int retained); 34 | Publications* MQTTProtocol_storePublication(Publish* publish, int* len); 35 | int messageIDCompare(void* a, void* b); 36 | int MQTTProtocol_assignMsgId(Clients* client); 37 | void MQTTProtocol_removePublication(Publications* p); 38 | 39 | int MQTTProtocol_handlePublishes(void* pack, int sock); 40 | int MQTTProtocol_handlePubacks(void* pack, int sock); 41 | int MQTTProtocol_handlePubrecs(void* pack, int sock); 42 | int MQTTProtocol_handlePubrels(void* pack, int sock); 43 | int MQTTProtocol_handlePubcomps(void* pack, int sock); 44 | 45 | void MQTTProtocol_keepalive(time_t); 46 | void MQTTProtocol_retry(time_t, int, int); 47 | void MQTTProtocol_freeClient(Clients* client); 48 | void MQTTProtocol_emptyMessageList(List* msgList); 49 | void MQTTProtocol_freeMessageList(List* msgList); 50 | 51 | char* MQTTStrncpy(char *dest, const char* src, size_t num); 52 | char* MQTTStrdup(const char* src); 53 | #endif 54 | -------------------------------------------------------------------------------- /components/mqtt/MQTTProtocolOut.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 | * Ian Craggs - MQTT 3.1.1 support 17 | *******************************************************************************/ 18 | 19 | #if !defined(MQTTPROTOCOLOUT_H) 20 | #define MQTTPROTOCOLOUT_H 21 | 22 | #include "LinkedList.h" 23 | #include "MQTTPacket.h" 24 | #include "Clients.h" 25 | #include "Log.h" 26 | #include "Messages.h" 27 | #include "MQTTProtocol.h" 28 | #include "MQTTProtocolClient.h" 29 | 30 | #define DEFAULT_PORT 1883 31 | 32 | void MQTTProtocol_reconnect(const char* ip_address, Clients* client); 33 | #if defined(OPENSSL) 34 | int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int ssl, int MQTTVersion); 35 | #else 36 | int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int MQTTVersion); 37 | #endif 38 | int MQTTProtocol_handlePingresps(void* pack, int sock); 39 | int MQTTProtocol_subscribe(Clients* client, List* topics, List* qoss, int msgID); 40 | int MQTTProtocol_handleSubacks(void* pack, int sock); 41 | int MQTTProtocol_unsubscribe(Clients* client, List* topics, int msgID); 42 | int MQTTProtocol_handleUnsubacks(void* pack, int sock); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /components/mqtt/Makefile.projbuild: -------------------------------------------------------------------------------- 1 | CFLAGS += -DNO_PERSISTENCE 2 | CFLAGS += -DNOSTACKTRACE -------------------------------------------------------------------------------- /components/mqtt/Messages.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | #if !defined(MESSAGES_H) 18 | #define MESSAGES_H 19 | 20 | char* Messages_get(int, int); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /components/mqtt/SSLSocket.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs, Allan Stockdill-Mander - initial implementation 15 | *******************************************************************************/ 16 | #if !defined(SSLSOCKET_H) 17 | #define SSLSOCKET_H 18 | 19 | #if defined(WIN32) || defined(WIN64) 20 | #define ssl_mutex_type HANDLE 21 | #else 22 | #include 23 | #include 24 | #define ssl_mutex_type pthread_mutex_t 25 | #endif 26 | 27 | #include 28 | #include "SocketBuffer.h" 29 | #include "Clients.h" 30 | 31 | #define URI_SSL "ssl://" 32 | 33 | int SSLSocket_initialize(); 34 | void SSLSocket_terminate(); 35 | int SSLSocket_setSocketForSSL(networkHandles* net, MQTTClient_SSLOptions* opts); 36 | int SSLSocket_getch(SSL* ssl, int socket, char* c); 37 | char *SSLSocket_getdata(SSL* ssl, int socket, size_t bytes, size_t* actual_len); 38 | 39 | int SSLSocket_close(networkHandles* net); 40 | int SSLSocket_putdatas(SSL* ssl, int socket, char* buf0, size_t buf0len, int count, char** buffers, size_t* buflens, int* frees); 41 | int SSLSocket_connect(SSL* ssl, int socket); 42 | 43 | int SSLSocket_getPendingRead(); 44 | int SSLSocket_continueWrite(pending_writes* pw); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /components/mqtt/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Component Makefile 3 | # 4 | 5 | COMPONENT_SRCDIRS := . option 6 | COMPONENT_ADD_INCLUDEDIRS := . -------------------------------------------------------------------------------- /components/mqtt/memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: memory.h 3 | * Author: jolive 4 | * 5 | * Created on September 8, 2015, 12:35 PM 6 | */ 7 | 8 | #ifndef MEMORY_H 9 | #define MEMORY_H 10 | 11 | #endif /* MEMORY_H */ 12 | 13 | -------------------------------------------------------------------------------- /components/mqtt/utf-8.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2013 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | #if !defined(UTF8_H) 18 | #define UTF8_H 19 | 20 | int UTF8_validate(int len, char* data); 21 | int UTF8_validateString(const char* string); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /components/spiffs/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Component Makefile 3 | # 4 | 5 | COMPONENT_SRCDIRS := . 6 | COMPONENT_ADD_INCLUDEDIRS := . 7 | COMPONENT_PRIV_INCLUDEDIRS := -------------------------------------------------------------------------------- /components/spiffs/esp_spiffs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lua RTOS, write syscall implementation 3 | * 4 | * Copyright (C) 2015 - 2017 5 | * IBEROXARXA SERVICIOS INTEGRALES, S.L. & CSS IBÉRICA, S.L. 6 | * 7 | * Author: Jaume Olivé (jolive@iberoxarxa.com / jolive@whitecatboard.org) 8 | * 9 | * All rights reserved. 10 | * 11 | * Permission to use, copy, modify, and distribute this software 12 | * and its documentation for any purpose and without fee is hereby 13 | * granted, provided that the above copyright notice appear in all 14 | * copies and that both that the copyright notice and this 15 | * permission notice and warranty disclaimer appear in supporting 16 | * documentation, and that the name of the author not be used in 17 | * advertising or publicity pertaining to distribution of the 18 | * software without specific, written prior permission. 19 | * 20 | * The author disclaim all warranties with regard to this 21 | * software, including all implied warranties of merchantability 22 | * and fitness. In no event shall the author be liable for any 23 | * special, indirect or consequential damages or any damages 24 | * whatsoever resulting from loss of use, data or profits, whether 25 | * in an action of contract, negligence or other tortious action, 26 | * arising out of or in connection with the use or performance of 27 | * this software. 28 | */ 29 | 30 | #ifndef __ESP_SPIFFS_H__ 31 | #define __ESP_SPIFFS_H__ 32 | 33 | #include "spiffs.h" 34 | 35 | s32_t esp32_spi_flash_read(u32_t addr, u32_t size, u8_t *dst); 36 | s32_t esp32_spi_flash_write(u32_t addr, u32_t size, const u8_t *src); 37 | s32_t esp32_spi_flash_erase(u32_t addr, u32_t size); 38 | 39 | #define low_spiffs_read (spiffs_read *)esp32_spi_flash_read 40 | #define low_spiffs_write (spiffs_write *)esp32_spi_flash_write 41 | #define low_spiffs_erase (spiffs_erase *)esp32_spi_flash_erase 42 | 43 | #endif // __ESP_SPIFFS_H__ 44 | -------------------------------------------------------------------------------- /components/spiffs_image/Makefile.projbuild: -------------------------------------------------------------------------------- 1 | SPIFFS_IMAGE_COMPONENT_PATH := $(COMPONENT_PATH) 2 | 3 | .PHONY: flashfs 4 | 5 | flashfs: $(SDKCONFIG_MAKEFILE) mkspiffs 6 | @echo "Making spiffs image ..." 7 | @echo "$(ESPTOOLPY_WRITE_FLASH)" 8 | $(MKSPIFFS_COMPONENT_PATH)/../mkspiffs/src/mkspiffs -c $(SPIFFS_IMAGE_COMPONENT_PATH)/image -b 8192 -p 256 -s $(CONFIG_LUA_RTOS_SPIFFS_SIZE) $(BUILD_DIR_BASE)/spiffs_image.img 9 | $(ESPTOOLPY_WRITE_FLASH) 0x$(CONFIG_LUA_RTOS_SPIFFS_BASE_ADDR) $(BUILD_DIR_BASE)/spiffs_image.img 10 | -------------------------------------------------------------------------------- /components/spiffs_image/image/@font/BigFont.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/@font/BigFont.fon -------------------------------------------------------------------------------- /components/spiffs_image/image/@font/DejaVuSans12.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/@font/DejaVuSans12.fon -------------------------------------------------------------------------------- /components/spiffs_image/image/@font/DejaVuSans18.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/@font/DejaVuSans18.fon -------------------------------------------------------------------------------- /components/spiffs_image/image/@font/DejaVuSans24.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/@font/DejaVuSans24.fon -------------------------------------------------------------------------------- /components/spiffs_image/image/@font/DotMatrix_M.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/@font/DotMatrix_M.fon -------------------------------------------------------------------------------- /components/spiffs_image/image/@font/Grotesk24x48.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/@font/Grotesk24x48.fon -------------------------------------------------------------------------------- /components/spiffs_image/image/@font/SmallFont.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/@font/SmallFont.fon -------------------------------------------------------------------------------- /components/spiffs_image/image/@font/Ubuntu.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/@font/Ubuntu.fon -------------------------------------------------------------------------------- /components/spiffs_image/image/@font/arial_bold.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/@font/arial_bold.fon -------------------------------------------------------------------------------- /components/spiffs_image/image/@font/swiss721_outline.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/@font/swiss721_outline.fon -------------------------------------------------------------------------------- /components/spiffs_image/image/autorun.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/autorun.lua -------------------------------------------------------------------------------- /components/spiffs_image/image/examples/lua/abp.lua: -------------------------------------------------------------------------------- 1 | -- ---------------------------------------------------------------- 2 | -- WHITECAT ECOSYSTEM 3 | -- 4 | -- Lua RTOS examples 5 | -- ---------------------------------------------------------------- 6 | -- Send a frame via LoRa WAN using ABP 7 | -- ---------------------------------------------------------------- 8 | os.loglevel(os.LOG_ALL) 9 | 10 | -- Register received callbacks 11 | lora.whenReceived(function(port, payload) 12 | print("port "..port) 13 | print("payload "..payload) 14 | end) 15 | 16 | -- Setup LoRa WAN 17 | lora.setup(lora.BAND868) 18 | lora.setDevAddr("26011728") 19 | lora.setNwksKey("5DD8013B282A725F51B1227F311EEFB1") 20 | lora.setAppsKey("9F09A4C74BAEDCB06669A4AC1D7ACB68") 21 | lora.setDr(5) 22 | lora.setReTx(0) 23 | 24 | -- Send frame 25 | lora.tx(false,1,pack.pack(25.3)) -------------------------------------------------------------------------------- /components/spiffs_image/image/examples/lua/adc-tmp36.lua: -------------------------------------------------------------------------------- 1 | -- ---------------------------------------------------------------- 2 | -- WHITECAT ECOSYSTEM 3 | -- 4 | -- Lua RTOS examples 5 | -- ---------------------------------------------------------------- 6 | -- Read adc value from a TMP36 temperature sensor and shows 7 | -- current temperature value on the screen. 8 | -- ---------------------------------------------------------------- 9 | 10 | tmp36_adc = adc.ADC1 -- Sensor is connected to ADC1 module 11 | tmp36_chan = adc.ADC_CH4 -- Sensor is connected to ADC1 chan 4 (GPIO32) 12 | tmp36_chan_res = 12 -- Channel resolution 13 | 14 | -- Setup ADC module 15 | tmp36 = adc.setup(tmp36_adc, tmp36_chan, tmp36_chan_res) 16 | 17 | -- Sample 18 | while true do 19 | -- Read from adc 20 | val, mval = tmp36:read() 21 | 22 | -- Computes temperature 23 | temp = (mval - 500) / 10 24 | 25 | -- Show temperature 26 | print("raw: "..val.."\t mvolts: "..mval.."\t temp: "..string.format("%.2f", temp)) 27 | 28 | -- Wait 29 | tmr.delay(1) 30 | end 31 | -------------------------------------------------------------------------------- /components/spiffs_image/image/examples/lua/blink.lua: -------------------------------------------------------------------------------- 1 | -- ---------------------------------------------------------------- 2 | -- WHITECAT ECOSYSTEM 3 | -- 4 | -- Lua RTOS examples 5 | -- ---------------------------------------------------------------- 6 | -- Read blink a led in a thread. While led is blinking Lua 7 | -- interpreter are available, you cant start new threads for 8 | -- doing other things. 9 | -- ---------------------------------------------------------------- 10 | 11 | thread.start(function() 12 | pio.pin.setdir(pio.OUTPUT, pio.GPIO14) 13 | pio.pin.setpull(pio.NOPULL, pio.GPIO14) 14 | while true do 15 | pio.pin.setval(1, pio.GPIO14) 16 | tmr.delayms(100) 17 | pio.pin.setval(0, pio.GPIO14) 18 | tmr.delayms(100) 19 | end 20 | end) -------------------------------------------------------------------------------- /components/spiffs_image/image/examples/lua/i2c.lua: -------------------------------------------------------------------------------- 1 | -- ---------------------------------------------------------------- 2 | -- WHITECAT ECOSYSTEM 3 | -- 4 | -- Lua RTOS examples 5 | -- ---------------------------------------------------------------- 6 | -- This sample demonstrates how to communicate with i2c devices. 7 | -- The sample writes values into an EEPROM (4c256d) and then 8 | -- read from the EEPROM and test that readed values are the writed 9 | -- values. 10 | -- ---------------------------------------------------------------- 11 | 12 | -- Setup i2c 13 | eeprom = i2c.setup(i2c.I2C0, i2c.MASTER, 1, pio.GPIO16, pio.GPIO27) 14 | 15 | -- Write 16 | for i=0,100 do 17 | eeprom:start() 18 | eeprom:address(0x51, false) 19 | eeprom:write(0x00) 20 | eeprom:write(i) 21 | eeprom:write(i) 22 | eeprom:stop() 23 | 24 | -- This is only for test purposes 25 | -- It should be done by ACKNOWLEDGE POLLING 26 | tmr.delayms(20) 27 | end 28 | 29 | -- Read and test 30 | for i=0,100 do 31 | eeprom:start() 32 | eeprom:address(0x51, false) 33 | eeprom:write(0x00) 34 | eeprom:write(i) 35 | eeprom:start() 36 | eeprom:address(0x51, true) 37 | if (eeprom:read() ~= i) then 38 | print("Error for "..i) 39 | end 40 | eeprom:stop() 41 | end 42 | 43 | -------------------------------------------------------------------------------- /components/spiffs_image/image/examples/lua/lora.lua: -------------------------------------------------------------------------------- 1 | function send() 2 | -- Update log level for show all log messages 3 | os.loglevel(os.LOG_ALL) 4 | 5 | -- Setup LoRa Wan, and send a confirmed packet 6 | lora.setup(lora.BAND868) 7 | lora.setAppEui("70B3D57ED0000740") 8 | lora.setAppKey("8CDB905A8073C80FCE188EBC674109FC") 9 | lora.setDevEui("70B3D57E00000000") 10 | lora.setDr(0) 11 | lora.setAdr(false) 12 | lora.join(lora.OTAA) 13 | lora.tx(true,1,pack.pack(25.3)) 14 | end 15 | 16 | send() 17 | -------------------------------------------------------------------------------- /components/spiffs_image/image/examples/lua/mqtt.lua: -------------------------------------------------------------------------------- 1 | -- ---------------------------------------------------------------- 2 | -- WHITECAT ECOSYSTEM 3 | -- 4 | -- Lua RTOS examples 5 | -- ---------------------------------------------------------------- 6 | -- This example demonstrates the use of the Lua MQTT module. 7 | -- ---------------------------------------------------------------- 8 | 9 | -- Configure wifi in Station Mode with SSID from Citilab 10 | net.wf.setup(net.wf.mode.STA, "CITILAB","wifi@citilab") 11 | 12 | -- Start wifi 13 | net.wf.start() 14 | 15 | -- Connect to MQTT server from cssiberica.com 16 | client = mqtt.client("100", "cssiberica.com", 1883, false) 17 | client:connect("","") 18 | 19 | -- Publis to queue 20 | client:publish("/100","hola",mqtt.QOS0) -------------------------------------------------------------------------------- /components/spiffs_image/image/examples/lua/neopixel.lua: -------------------------------------------------------------------------------- 1 | -- ---------------------------------------------------------------- 2 | -- WHITECAT ECOSYSTEM 3 | -- 4 | -- Lua RTOS examples 5 | -- ---------------------------------------------------------------- 6 | -- NEOPIXEL example 7 | -- ---------------------------------------------------------------- 8 | 9 | thread.start(function() 10 | neo = neopixel.setup(neopixel.WS2812B, pio.GPIO14, 6) 11 | 12 | pixel = 0 13 | direction = 0 14 | 15 | while true do 16 | neo:setPixel(pixel, 0, 255, 0) 17 | neo:update() 18 | tmr.delayms(100) 19 | neo:setPixel(pixel, 0, 00, 0) 20 | 21 | if (direction == 0) then 22 | if (pixel == 5) then 23 | direction = 1 24 | pixel = 4 25 | else 26 | pixel = pixel + 1 27 | end 28 | else 29 | if (pixel == 0) then 30 | direction = 0 31 | pixel = 1 32 | else 33 | pixel = pixel - 1 34 | end 35 | end 36 | end 37 | end) -------------------------------------------------------------------------------- /components/spiffs_image/image/examples/lua/pwm.lua: -------------------------------------------------------------------------------- 1 | -- ---------------------------------------------------------------- 2 | -- WHITECAT ECOSYSTEM 3 | -- 4 | -- Lua RTOS examples 5 | -- ---------------------------------------------------------------- 6 | -- This example demonstrates the use of the Lua PWM module 7 | -- for control led's brightness 8 | -- ---------------------------------------------------------------- 9 | 10 | -- Led brightness is controled by this PWM channel 11 | led_pwm_chan = pwm.PWM_CH0 12 | 13 | -- Led is connected to this GPIO 14 | led_pwm_gpio = pio.GPIO27 15 | 16 | -- Setup pwm module0 17 | pwm0 = pwm.setup(pwm.PWM0) 18 | 19 | -- Setup pwm at 10 Khz, initial duty is 0 20 | led = pwm0:setupchan(led_pwm_chan, led_pwm_gpio, 10000, 0) 21 | 22 | -- Start led 23 | led:start() 24 | 25 | while true do 26 | -- Set duty from 0% to 100% at 10ms interval 27 | for duty = 0, 100 do 28 | led:setduty(duty / 100) 29 | tmr.delayms(10); 30 | end 31 | 32 | -- Set duty from 100% to 0% at 10ms interval 33 | for duty = 0, 100 do 34 | led:setduty((100 - duty) / 100) 35 | tmr.delayms(10); 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /components/spiffs_image/image/examples/lua/stepper.lua: -------------------------------------------------------------------------------- 1 | -- ---------------------------------------------------------------- 2 | -- WHITECAT ECOSYSTEM 3 | -- 4 | -- Lua RTOS examples 5 | -- ---------------------------------------------------------------- 6 | -- This example demonstrates the use of the Lua stepper module. 7 | -- ---------------------------------------------------------------- 8 | 9 | dir = 1 10 | 11 | -- Attach 2 steppers 12 | -- 13 | -- stepper1: dir pin at GPIO26, step pin at GPIO14 14 | -- stepper2: dir pin at GPIO12, step pin at GPIO13 15 | -- 16 | -- Steppers are configured by default: 17 | -- 18 | -- steps per unit (revolutions): 200 19 | -- min speed: 60 rpm 20 | -- max speed: 800 rpm 21 | -- acceleration: 2 revolutions / secs^2 22 | s1 = stepper.attach(pio.GPIO26, pio.GPIO14) 23 | s2 = stepper.attach(pio.GPIO12, pio.GPIO13) 24 | 25 | -- Move the steppers (10 revolutions), in bucle, changing the 26 | -- direction 27 | while true do 28 | s1:move(dir * 10) 29 | s2:move(dir * 10) 30 | 31 | stepper.start(s1,s2) 32 | 33 | if (dir == 1) then 34 | dir = -1 35 | else 36 | dir = 1 37 | end 38 | end -------------------------------------------------------------------------------- /components/spiffs_image/image/examples/lua/wifi.lua: -------------------------------------------------------------------------------- 1 | -- ---------------------------------------------------------------- 2 | -- WHITECAT ECOSYSTEM 3 | -- 4 | -- Lua RTOS examples 5 | -- ---------------------------------------------------------------- 6 | -- This example demonstrates the use of the Lua Wifi module. 7 | -- ---------------------------------------------------------------- 8 | 9 | -- Wifi scan 10 | net.wf.scan() 11 | 12 | -- Configure wifi in Station Mode with SSID from Citilab 13 | net.wf.setup(net.wf.mode.STA, "CITILAB","wifi@citilab") 14 | 15 | -- Start wifi 16 | net.wf.start() 17 | 18 | -- Get current time from sntp server 19 | net.service.sntp.start() 20 | net.service.sntp.stop() 21 | 22 | -- Perform a DNS look up 23 | print("whitecarboard.org: "..net.lookup("whitecatboard.org")) 24 | 25 | -- Ping to google 26 | net.ping("8.8.8.8") -------------------------------------------------------------------------------- /components/spiffs_image/image/images/nature_160x123.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/images/nature_160x123.img -------------------------------------------------------------------------------- /components/spiffs_image/image/images/newyear_128x96.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/images/newyear_128x96.img -------------------------------------------------------------------------------- /components/spiffs_image/image/images/tiger.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/images/tiger.bmp -------------------------------------------------------------------------------- /components/spiffs_image/image/images/tiger240.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/images/tiger240.jpg -------------------------------------------------------------------------------- /components/spiffs_image/image/sys/zoneinfo/GB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/sys/zoneinfo/GB -------------------------------------------------------------------------------- /components/spiffs_image/image/sys/zoneinfo/GMT: -------------------------------------------------------------------------------- 1 | TZifGMT -------------------------------------------------------------------------------- /components/spiffs_image/image/sys/zoneinfo/Madrid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/sys/zoneinfo/Madrid -------------------------------------------------------------------------------- /components/spiffs_image/image/sys/zoneinfo/UTC: -------------------------------------------------------------------------------- 1 | TZifUTC -------------------------------------------------------------------------------- /components/spiffs_image/image/sys/zoneinfo/localtime: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/sys/zoneinfo/localtime -------------------------------------------------------------------------------- /components/spiffs_image/image/sys/zoneinfo/posixrules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/sys/zoneinfo/posixrules -------------------------------------------------------------------------------- /components/spiffs_image/image/system.lua: -------------------------------------------------------------------------------- 1 | -- system.lua 2 | -- 3 | -- This script is executed after a system boot or a system reset and is intended 4 | -- for setup the system. 5 | 6 | --------------------------------------------------- 7 | -- Main setups 8 | --------------------------------------------------- 9 | os.loglevel(os.LOG_INFO) -- Log level to info 10 | os.logcons(true) -- Enable/disable sys log messages to console 11 | os.shell(false) -- Enable/disable shell 12 | os.history(true) -- Enable/disable history 13 | -------------------------------------------------------------------------------- /components/spiffs_image/image/tests/db.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/tests/db.lua -------------------------------------------------------------------------------- /components/spiffs_image/image/tests/files.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/tests/files.lua -------------------------------------------------------------------------------- /components/spiffs_image/image/tests/libs/lib1.c: -------------------------------------------------------------------------------- 1 | #include "lua.h" 2 | #include "lauxlib.h" 3 | 4 | static int id (lua_State *L) { 5 | return lua_gettop(L); 6 | } 7 | 8 | 9 | static const struct luaL_Reg funcs[] = { 10 | {"id", id}, 11 | {NULL, NULL} 12 | }; 13 | 14 | 15 | /* function used by lib11.c */ 16 | LUAMOD_API int lib1_export (lua_State *L) { 17 | lua_pushstring(L, "exported"); 18 | return 1; 19 | } 20 | 21 | 22 | LUAMOD_API int onefunction (lua_State *L) { 23 | luaL_checkversion(L); 24 | lua_settop(L, 2); 25 | lua_pushvalue(L, 1); 26 | return 2; 27 | } 28 | 29 | 30 | LUAMOD_API int anotherfunc (lua_State *L) { 31 | luaL_checkversion(L); 32 | lua_pushfstring(L, "%d%%%d\n", (int)lua_tointeger(L, 1), 33 | (int)lua_tointeger(L, 2)); 34 | return 1; 35 | } 36 | 37 | 38 | LUAMOD_API int luaopen_lib1_sub (lua_State *L) { 39 | lua_setglobal(L, "y"); /* 2nd arg: extra value (file name) */ 40 | lua_setglobal(L, "x"); /* 1st arg: module name */ 41 | luaL_newlib(L, funcs); 42 | return 1; 43 | } 44 | 45 | -------------------------------------------------------------------------------- /components/spiffs_image/image/tests/libs/lib11.c: -------------------------------------------------------------------------------- 1 | #include "lua.h" 2 | 3 | /* function from lib1.c */ 4 | int lib1_export (lua_State *L); 5 | 6 | LUAMOD_API int luaopen_lib11 (lua_State *L) { 7 | return lib1_export(L); 8 | } 9 | 10 | 11 | -------------------------------------------------------------------------------- /components/spiffs_image/image/tests/libs/lib2.c: -------------------------------------------------------------------------------- 1 | #include "lua.h" 2 | #include "lauxlib.h" 3 | 4 | static int id (lua_State *L) { 5 | return lua_gettop(L); 6 | } 7 | 8 | 9 | static const struct luaL_Reg funcs[] = { 10 | {"id", id}, 11 | {NULL, NULL} 12 | }; 13 | 14 | 15 | LUAMOD_API int luaopen_lib2 (lua_State *L) { 16 | lua_settop(L, 2); 17 | lua_setglobal(L, "y"); /* y gets 2nd parameter */ 18 | lua_setglobal(L, "x"); /* x gets 1st parameter */ 19 | luaL_newlib(L, funcs); 20 | return 1; 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /components/spiffs_image/image/tests/libs/lib21.c: -------------------------------------------------------------------------------- 1 | #include "lua.h" 2 | 3 | 4 | int luaopen_lib2 (lua_State *L); 5 | 6 | LUAMOD_API int luaopen_lib21 (lua_State *L) { 7 | return luaopen_lib2(L); 8 | } 9 | 10 | 11 | -------------------------------------------------------------------------------- /components/spiffs_image/image/tests/libs/makefile: -------------------------------------------------------------------------------- 1 | # change this variable to point to the directory with Lua headers 2 | # of the version being tested 3 | LUA_DIR = ../.. 4 | 5 | CC = gcc 6 | 7 | # compilation should generate Dynamic-Link Libraries 8 | CFLAGS = -Wall -std=gnu99 -O2 -I$(LUA_DIR) -fPIC -shared 9 | 10 | # libraries used by the tests 11 | all: lib1.so lib11.so lib2.so lib21.so lib2-v2.so 12 | 13 | lib1.so: lib1.c 14 | $(CC) $(CFLAGS) -o lib1.so lib1.c 15 | 16 | lib11.so: lib11.c 17 | $(CC) $(CFLAGS) -o lib11.so lib11.c 18 | 19 | lib2.so: lib2.c 20 | $(CC) $(CFLAGS) -o lib2.so lib2.c 21 | 22 | lib21.so: lib21.c 23 | $(CC) $(CFLAGS) -o lib21.so lib21.c 24 | 25 | lib2-v2.so: lib2.so 26 | mv lib2.so ./lib2-v2.so 27 | -------------------------------------------------------------------------------- /components/spiffs_image/image/tests/pm.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/tests/pm.lua -------------------------------------------------------------------------------- /components/spiffs_image/image/tests/sort.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/tests/sort.lua -------------------------------------------------------------------------------- /components/spiffs_image/image/tests/strings.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/components/spiffs_image/image/tests/strings.lua -------------------------------------------------------------------------------- /components/spiffs_image/image/tests/test.lua: -------------------------------------------------------------------------------- 1 | _soft = true 2 | 3 | tests = {} 4 | 5 | -- table.insert(tests, function() dofile('main.lua') end) 6 | table.insert(tests, function() dofile("gc.lua") end) 7 | -- table.insert(tests, function() dofile('db.lua') end) 8 | table.insert(tests, function() assert(dofile('calls.lua') == deep and deep) end) 9 | table.insert(tests, function() dofile('strings.lua') end) 10 | table.insert(tests, function() dofile('literals.lua') end) 11 | table.insert(tests, function() dofile('tpack.lua') end) 12 | --table.insert(tests, function() assert(dofile('attrib.lua') == 27) end) 13 | table.insert(tests, function() assert(dofile('locals.lua') == 5) end) 14 | table.insert(tests, function() dofile('constructs.lua') end) 15 | --table.insert(tests, function() dofile('code.lua', true) end) 16 | --table.insert(tests, function() dofile('nextvar.lua') end) 17 | table.insert(tests, function() dofile('pm.lua') end) 18 | table.insert(tests, function() dofile('utf8.lua') end) 19 | --table.insert(tests, function() dofile('api.lua') end) 20 | table.insert(tests, function() assert(dofile('events.lua') == 12) end) 21 | table.insert(tests, function() dofile('vararg.lua') end) 22 | table.insert(tests, function() dofile('closure.lua') end) 23 | table.insert(tests, function() dofile('coroutine.lua') end) 24 | table.insert(tests, function() dofile('goto.lua', true) end) 25 | --table.insert(tests, function() dofile('errors.lua') end) 26 | table.insert(tests, function() dofile('math.lua') end) 27 | table.insert(tests, function() dofile('sort.lua', true) end) 28 | table.insert(tests, function() dofile('bitwise.lua') end) 29 | --table.insert(tests, function() assert(dofile('verybig.lua', true) == 10) end) 30 | --table.insert(tests, function() dofile('files.lua') end) 31 | table.insert(tests, function() dofile('bitwise.lua') end) 32 | 33 | if os.bootcount() == 1 then 34 | os.remove("/tests/test.log") 35 | end 36 | 37 | if os.bootcount() < #tests then 38 | os.stdout("/tests/test.log") 39 | tests[os.bootcount()]() 40 | os.stdout() 41 | os.sleep(0) 42 | end 43 | -------------------------------------------------------------------------------- /components/unity/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Component Makefile 3 | # 4 | -------------------------------------------------------------------------------- /components/unity/license.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /components/zlib/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Component Makefile 3 | # 4 | 5 | COMPONENT_SRCDIRS := . 6 | COMPONENT_ADD_INCLUDEDIRS := . -------------------------------------------------------------------------------- /components/zlib/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(file) 12 | gzFile file; 13 | { 14 | #ifndef NO_GZCOMPRESS 15 | gz_statep state; 16 | 17 | if (file == NULL) 18 | return Z_STREAM_ERROR; 19 | state = (gz_statep)file; 20 | 21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 22 | #else 23 | return gzclose_r(file); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /components/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /examples/@font/BigFont.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/examples/@font/BigFont.fon -------------------------------------------------------------------------------- /examples/@font/DejaVuSans12.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/examples/@font/DejaVuSans12.fon -------------------------------------------------------------------------------- /examples/@font/DejaVuSans18.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/examples/@font/DejaVuSans18.fon -------------------------------------------------------------------------------- /examples/@font/DejaVuSans24.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/examples/@font/DejaVuSans24.fon -------------------------------------------------------------------------------- /examples/@font/DotMatrix_M.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/examples/@font/DotMatrix_M.fon -------------------------------------------------------------------------------- /examples/@font/Grotesk24x48.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/examples/@font/Grotesk24x48.fon -------------------------------------------------------------------------------- /examples/@font/SmallFont.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/examples/@font/SmallFont.fon -------------------------------------------------------------------------------- /examples/@font/Ubuntu.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/examples/@font/Ubuntu.fon -------------------------------------------------------------------------------- /examples/@font/arial_bold.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/examples/@font/arial_bold.fon -------------------------------------------------------------------------------- /examples/@font/swiss721_outline.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/examples/@font/swiss721_outline.fon -------------------------------------------------------------------------------- /examples/nature.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/examples/nature.bmp -------------------------------------------------------------------------------- /examples/nature_160x123.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/examples/nature_160x123.img -------------------------------------------------------------------------------- /examples/newyear_128x96.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/examples/newyear_128x96.img -------------------------------------------------------------------------------- /examples/tiger.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/examples/tiger.bmp -------------------------------------------------------------------------------- /examples/tiger240.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/examples/tiger240.jpg -------------------------------------------------------------------------------- /main/.settings/language.settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /main/.settings/org.eclipse.cdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/project/cdt.managedbuild.toolchain.gnu.cross.base.220215919/IDF_PATH/delimiter=\: 3 | environment/project/cdt.managedbuild.toolchain.gnu.cross.base.220215919/IDF_PATH/operation=append 4 | environment/project/cdt.managedbuild.toolchain.gnu.cross.base.220215919/IDF_PATH/value=/Users/jaumeolivepetrus/esp-idf 5 | environment/project/cdt.managedbuild.toolchain.gnu.cross.base.220215919/PATH/delimiter=\: 6 | environment/project/cdt.managedbuild.toolchain.gnu.cross.base.220215919/PATH/operation=replace 7 | environment/project/cdt.managedbuild.toolchain.gnu.cross.base.220215919/PATH/value=/usr/local/xtensa-esp32-elf/bin\:/bin\:/usr/bin\:/usr/sbin\:/sbin 8 | environment/project/cdt.managedbuild.toolchain.gnu.cross.base.220215919/append=true 9 | environment/project/cdt.managedbuild.toolchain.gnu.cross.base.220215919/appendContributed=true 10 | environment/project/cdt.managedbuild.toolchain.gnu.cross.base.220215919/v/delimiter=\: 11 | environment/project/cdt.managedbuild.toolchain.gnu.cross.base.220215919/v/operation=append 12 | environment/project/cdt.managedbuild.toolchain.gnu.cross.base.220215919/v/value=1 13 | -------------------------------------------------------------------------------- /main/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Main Makefile. This is basically the same as a component makefile. 3 | # 4 | # This Makefile should, at the very least, just include $(SDK_PATH)/make/component_common.mk. By default, 5 | # this will take the sources in the src/ directory, compile them and link them into 6 | # lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable, 7 | # please read the ESP-IDF documents if you need to do this. 8 | # 9 | -------------------------------------------------------------------------------- /main/patches/api_msg.patch: -------------------------------------------------------------------------------- 1 | --- /Users/jaumeolivepetrus/esp-idf/components/lwip/api/api_msg.c 2016-12-30 00:37:16.000000000 +0100 2 | +++ api_msg.c 2016-12-30 00:40:01.000000000 +0100 3 | @@ -869,7 +869,7 @@ 4 | } 5 | } 6 | } 7 | - if ((err == ERR_OK) && (tpcb != NULL)) 8 | + if ((err == ERR_OK) && (tpcb != NULL) && (!linger_wait_required)) 9 | #endif /* LWIP_SO_LINGER */ 10 | { 11 | err = tcp_close(tpcb); 12 | -------------------------------------------------------------------------------- /main/patches/free_rtos_config.patch: -------------------------------------------------------------------------------- 1 | --- a/esp-idf-orig/esp-idf/components/freertos/include/freertos/FreeRTOSConfig.h 2 | +++ b/esp-idf/components/freertos/include/freertos/FreeRTOSConfig.h 3 | @@ -252,7 +252,7 @@ 4 | /* Test FreeRTOS timers (with timer task) and more. */ 5 | /* Some files don't compile if this flag is disabled */ 6 | #define configUSE_TIMERS 1 7 | -#define configTIMER_TASK_PRIORITY 1 8 | +#define configTIMER_TASK_PRIORITY CONFIG_LUA_RTOS_LUA_TASK_PRIORITY 9 | #define configTIMER_QUEUE_LENGTH 10 10 | #define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE 11 | 12 | -------------------------------------------------------------------------------- /main/patches/spi_flash.2.patch: -------------------------------------------------------------------------------- 1 | --- /Users/jaumeolivepetrus/esp-idf-uniqueid/components/spi_flash/include/esp_spi_flash.h 2017-03-01 13:24:17.000000000 +0100 2 | +++ esp_spi_flash.h 2017-03-01 12:17:00.000000000 +0100 3 | @@ -305,6 +305,8 @@ 4 | 5 | #endif //CONFIG_SPI_FLASH_ENABLE_COUNTERS 6 | 7 | +void spi_flash_send_cmd(uint32_t len, uint8_t *cmd, uint8_t *res); 8 | + 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | -------------------------------------------------------------------------------- /main/test/lua_rtos/component.mk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/main/test/lua_rtos/component.mk -------------------------------------------------------------------------------- /main/test/lua_rtos/test/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | #Component Makefile 3 | # 4 | 5 | COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive -------------------------------------------------------------------------------- /tools/font/msvcp71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/tools/font/msvcp71.dll -------------------------------------------------------------------------------- /tools/font/msvcr71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/tools/font/msvcr71.dll -------------------------------------------------------------------------------- /tools/font/ttf2c_vc2003.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loboris/Lua-RTOS-ESP32-lobo/0f31cd188c35892d07acd2a8b697335d99415342/tools/font/ttf2c_vc2003.exe --------------------------------------------------------------------------------