Skip to content

Commit

Permalink
Lua (#39)
Browse files Browse the repository at this point in the history
Replace Berry with Lua
  • Loading branch information
dzurikmiroslav authored Jan 2, 2024
1 parent 370d2f5 commit cb9286a
Show file tree
Hide file tree
Showing 116 changed files with 32,437 additions and 2,840 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
platform: [esp32, esp32s2]
platform: [esp32, esp32s2, esp32s3]

steps:
- name: Checkout
Expand Down
5 changes: 1 addition & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "components/api/lib/cAT"]
path = components/api/lib/cAT
url = https://github.com/marcinbor85/cAT
[submodule "components/script/lib/berry"]
path = components/script/lib/berry
url = https://github.com/berry-lang/berry
url = https://github.com/marcinbor85/cAT
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ J1772 EVSE firmware for ESP32 based devices.
- OTA update
- Integrated energy meter
- [REST](https://github.com/dzurikmiroslav/esp32-evse/wiki/Rest) API
- MQTT API
- WebDAV
- [Modbus](https://github.com/dzurikmiroslav/esp32-evse/wiki/Modbus) (RS485, TCP)
- [Scripting](https://github.com/dzurikmiroslav/esp32-evse/wiki/Script)
- [Lua scripting](https://github.com/dzurikmiroslav/esp32-evse/wiki/Lua)
- [Nextion HMI](https://github.com/dzurikmiroslav/esp32-evse/wiki/Nextion)

### Device definition method
Expand Down
16 changes: 8 additions & 8 deletions components/evse/include/evse.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
#define evse_state_is_session(state) (state >= EVSE_STATE_B1 && state <= EVSE_STATE_D2)
#define evse_state_is_charging(state) (state == EVSE_STATE_C2 || state == EVSE_STATE_D2)

#define EVSE_ERR_PILOT_FAULT_BIT BIT0
#define EVSE_ERR_DIODE_SHORT_BIT BIT1
#define EVSE_ERR_LOCK_FAULT_BIT BIT2
#define EVSE_ERR_UNLOCK_FAULT_BIT BIT3
#define EVSE_ERR_RCM_TRIGGERED_BIT BIT4
#define EVSE_ERR_RCM_SELFTEST_FAULT_BIT BIT5
#define EVSE_ERR_TEMPERATURE_HIGH_BIT BIT6
#define EVSE_ERR_TEMPERATURE_FAULT_BIT BIT7
#define EVSE_ERR_PILOT_FAULT_BIT (1UL << 0)
#define EVSE_ERR_DIODE_SHORT_BIT (1UL << 1)
#define EVSE_ERR_LOCK_FAULT_BIT (1UL << 2)
#define EVSE_ERR_UNLOCK_FAULT_BIT (1UL << 3)
#define EVSE_ERR_RCM_TRIGGERED_BIT (1UL << 4)
#define EVSE_ERR_RCM_SELFTEST_FAULT_BIT (1UL << 5)
#define EVSE_ERR_TEMPERATURE_HIGH_BIT (1UL << 6)
#define EVSE_ERR_TEMPERATURE_FAULT_BIT (1UL << 7)

#define EVSE_ERR_AUTO_CLEAR_BITS (EVSE_ERR_PILOT_FAULT_BIT | EVSE_ERR_DIODE_SHORT_BIT | EVSE_ERR_RCM_TRIGGERED_BIT | EVSE_ERR_RCM_SELFTEST_FAULT_BIT)

Expand Down
89 changes: 40 additions & 49 deletions components/script/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,57 +1,48 @@
set(srcs
"lib/lua/lundump.c"
"lib/lua/lmem.c"
"lib/lua/ltm.c"
"lib/lua/linit.c"
"lib/lua/lbaselib.c"
"lib/lua/lopcodes.c"
"lib/lua/lauxlib.c"
"lib/lua/lstrlib.c"
"lib/lua/lcode.c"
"lib/lua/lzio.c"
"lib/lua/lvm.c"
"lib/lua/ltablib.c"
"lib/lua/lapi.c"
"lib/lua/lstring.c"
"lib/lua/llex.c"
"lib/lua/lparser.c"
"lib/lua/lmathlib.c"
"lib/lua/liolib.c"
"lib/lua/ldump.c"
"lib/lua/ltable.c"
"lib/lua/loslib.c"
"lib/lua/lfunc.c"
"lib/lua/lgc.c"
"lib/lua/lcorolib.c"
"lib/lua/loadlib.c"
"lib/lua/lobject.c"
"lib/lua/ldo.c"
"lib/lua/ldblib.c"
"lib/lua/lutf8lib.c"
"lib/lua/lstate.c"
"lib/lua/lctype.c"
"lib/lua/ldebug.c"
"src/script.c"
"src/be_board_config_lib.c"
"src/be_evse_lib.c"
"src/be_aux_lib.c"
"src/be_mqtt_client_lib.c"
"src/be_modtab.c"
"src/be_mapping_utils.c"
"src/be_port.c"
"lib/berry/src/be_api.c"
"lib/berry/src/be_baselib.c"
"lib/berry/src/be_bytecode.c"
"lib/berry/src/be_byteslib.c"
"lib/berry/src/be_class.c"
"lib/berry/src/be_code.c"
"lib/berry/src/be_debug.c"
"lib/berry/src/be_debuglib.c"
"lib/berry/src/be_exec.c"
"lib/berry/src/be_filelib.c"
"lib/berry/src/be_func.c"
"lib/berry/src/be_gc.c"
"lib/berry/src/be_gclib.c"
"lib/berry/src/be_globallib.c"
"lib/berry/src/be_introspectlib.c"
"lib/berry/src/be_jsonlib.c"
"lib/berry/src/be_lexer.c"
"lib/berry/src/be_libs.c"
"lib/berry/src/be_list.c"
"lib/berry/src/be_listlib.c"
"lib/berry/src/be_map.c"
"lib/berry/src/be_maplib.c"
"lib/berry/src/be_mathlib.c"
"lib/berry/src/be_mem.c"
"lib/berry/src/be_module.c"
"lib/berry/src/be_object.c"
"lib/berry/src/be_oslib.c"
"lib/berry/src/be_parser.c"
"lib/berry/src/be_rangelib.c"
"lib/berry/src/be_repl.c"
"lib/berry/src/be_solidifylib.c"
"lib/berry/src/be_strictlib.c"
"lib/berry/src/be_string.c"
"lib/berry/src/be_strlib.c"
"lib/berry/src/be_syslib.c"
"lib/berry/src/be_timelib.c"
"lib/berry/src/be_undefinedlib.c"
"lib/berry/src/be_var.c"
"lib/berry/src/be_vector.c"
"lib/berry/src/be_vm.c")
"src/l_evse_lib.c"
"src/l_mqtt_lib.c"
"src/l_json_lib.c"
"src/l_aux_lib.c"
"src/l_board_config_lib.c"
)

idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "include"
PRIV_INCLUDE_DIRS "src" "lib/berry/src"
PRIV_INCLUDE_DIRS "src" "lib/lua"
PRIV_REQUIRES nvs_flash app_update json mqtt driver esp_http_client esp_netif esp_wifi esp_timer esp_hw_support
REQUIRES network config evse peripherals protocols serial logger)

set_source_files_properties(lib/berry_mapping/src/be_cb_module.c PROPERTIES COMPILE_FLAGS -Wno-return-type)
set_source_files_properties(src/script.c PROPERTIES COMPILE_FLAGS -Wno-unused-value)
5 changes: 0 additions & 5 deletions components/script/berry-coc.sh

This file was deleted.

205 changes: 0 additions & 205 deletions components/script/generate/be_const_strtab.h

This file was deleted.

Loading

0 comments on commit cb9286a

Please sign in to comment.