Commit Graph

49 Commits

Author SHA1 Message Date
rusefillc ed6ed0d93e Air Conditioning Improvements #4054 2022-04-08 21:28:50 -04:00
rusefillc 7a675580a9 We have working runtime RAM detection - we shall use it for Lua #3970 2022-03-27 19:39:41 -04:00
rusefillc 970d63568f Revert "lua: TDD of enabling base lib"
This reverts commit d8b3712817.
2022-02-22 20:50:38 -05:00
rusefillc d80f3e0b80 Revert "lua: enabling string lib"
This reverts commit f4297bafe6.
2022-02-22 20:50:38 -05:00
rusefillc f4297bafe6 lua: enabling string lib 2022-02-22 17:31:44 -05:00
rusefillc d8b3712817 lua: TDD of enabling base lib 2022-02-22 16:25:41 -05:00
rusefi 89ea770f00 Lua CAN relay performance #3911 2022-02-13 00:07:36 -05:00
rusefillc 0d66a5873a Lua CAN relay performance #3911 2022-02-10 21:01:15 -05:00
rusefillc 3c73ca8dab random piece of https://github.com/dron0gus/rusefi/tree/f429-discovery-ram-dev 2022-01-09 22:42:24 -05:00
Andrey 940b04ab24 Let's always have TS structure so that unit tests can check values in outputChannels, kind of making outputChannels a god dump for state but whatever since Live View is coming 2021-12-07 20:18:47 -05:00
rusefillc 6d4b1e6020 proteus to have enlarged Lua
one step back
2021-11-30 22:35:29 -05:00
Matthew Kennedy 5eea2764f5
strtof (#3623)
* strtof

* do fewer divides
2021-11-26 18:39:45 -05:00
Scott Smith 9668626008
Move LuaThread to CCM, and shuffle a couple items out. (#3587)
Lua's stack probably doesn't need DMA.  Allows us to group more of our unused RAM together
in one place.
2021-11-21 20:35:03 -05:00
Matthew Kennedy bb57a4b084
detect more overflows with asan (#3582)
* overflow detector

* type list dynamic allocate

* fix the buffer length

* comment

* pr fb

* sanitize sim

* fix sim sanitizer bug

* didn't mean to turn off optimization for sim

* asan can do that, if you turn it on!

* cleaning
2021-11-20 01:38:39 -05:00
Scott Smith 823d9a07e0
Programmatically replace ENGINE() and CONFIG() with engine-> etc (#3565)
git grep -l -w ENGINE | xargs sed -i -r "s/ENGINE\(([]a-zA-Z_0-9.[]+)\)/engine->\1/g"

git grep -l -w CONFIG | xargs sed -i -r "s/([^a-zA-Z_])CONFIG\(([]a-zA-Z_0-9.[]+)\)/\1engineConfiguration->\2/g"
2021-11-17 03:54:21 -05:00
Matthew Kennedy a831bec797
update luaaa (#3540)
* lua update

* no stdlib mode

* turn off system luaaa for now since it makes luaaa sad

* let user heap do a little

* gitmodules

* memory shuffling

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-11-12 22:10:05 -05:00
Matthew Kennedy 57ad75aa98
load lua libs correctly (#3529)
* fix lua lib loading

* test
2021-11-11 13:44:13 -05:00
Matthew Kennedy 383d8caad9
Lua CAN RX (#3403)
* wiring

* static

* implementation

* comment

* unit tests happy

* guard

* guard smarter, not harder

* guard smarter not harder

* guard even smarter, not even harder

* don't need that
2021-10-24 08:37:04 -04:00
Matthew Kennedy ed7f7e693c
per-MCU lua size (#3339)
* per-MCU lua size

* simulator happy
2021-10-09 09:02:30 -04:00
rusefi 69ac9f7577 looks like a typo 2021-10-08 23:14:11 -04:00
rusefi e73ed5bcc5 luamemory does same but better 2021-10-08 14:48:16 -04:00
rusefillc 84c1b04de6 "luastats" command 2021-09-29 21:04:50 -04:00
Matthew Kennedy 0978722225
lua hook for timing add (#3260)
* load script

* test

* needs more rams

* embiggen stack

* init system lua from lua thread

* de-embiggen stack

* infra

* hook

* system needs a little more

* semicolon

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-09-23 23:50:47 -04:00
Matthew Kennedy f41a2715a3
system lua: load a script! (#3231)
* load script

* test

* needs more rams

* embiggen stack

* init system lua from lua thread

* de-embiggen stack

* system needs a little more

* memory

* om nom nom delicious memory

* how much more memory could it want

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-09-23 21:45:14 -04:00
rusefillc 38b9698fc4 let's throw gas at the problem! 2021-09-18 17:48:01 -04:00
rusefillc 3de124a1c6 refactoring 2021-09-18 17:44:55 -04:00
Matthew Kennedy c72bd07179
enable address sanitizer (#3217)
* enable asan

* lua

* this is dead and leaky

* leaky nissan

* fix pwm generator use-after-stack

* initializers

* prevent problems in case of invalid trigger shape

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-09-05 05:56:59 -04:00
Matthew Kennedy 57e01e2064
start system lua VM (#3219)
* start system lua vm

* show used

* message

* null if script load fails
2021-09-04 07:57:58 -04:00
Matthew Kennedy 206670e2c5
multiple lua heaps (#3215)
* multi lua heaps

* assert

* put it in a class

* put it in the class

* privacy
2021-09-03 03:45:23 -04:00
Matthew Kennedy 0731dbb479
lua pass alloc and script (#3179)
* pass alloc and script

* pass in all the spots
2021-08-19 15:14:02 -04:00
Matthew Kennedy 559656bdc2
lua & fsio cleanup (#3175) 2021-08-18 15:25:46 -04:00
Matthew Kennedy d24f1462e2
even more pch (#3112)
* s

* more

* s

* f7
2021-08-04 19:30:52 -04:00
Matthew Kennedy b52d50bbf2
Use pch in lots of files (#3066)
* most engine.h

* most engine_configuration

* more

* more

* more

* more

* more

* moooooore

* ok I'm done for now

* oops
2021-07-26 01:05:17 -04:00
Matthew Kennedy 2ce7777865
don't require EXTERN_ENGINE in every file (#2969)
* move enginePins

* no more extern engine

* uses

* more

* extern config too

* put this where it belongs

* include correct header

* merge
2021-07-16 18:13:33 -04:00
Matthew Kennedy a62d6743bc
lua hooks for CAN tx (#2967)
* CanTxMessage usable from unit test

* testLuaReturnsNil

* CAN hook and tests

* it helps if parameter names exist

* nameless params

* s

* redefinition of default argument

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-07-16 14:06:26 -04:00
Matthew Kennedy 3f63a108aa
deinit lua pins when not used (#2876)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-06-28 08:39:03 -04:00
Matthew Kennedy 20cef63d32
Lua on f407, try again (#2725)
* lua on f4

* move perf trace to efifeatures

* check that it's defined

* cypress and kinetis

* it would help to define the correct thing

* disable buffer if not used

* we can work with 2k

* turn off ramdisk on mre qc

* wow strncpy is useless for truncated strings

* turn off for bootloader

* lto bootloader

* memory

* memory
2021-05-20 23:05:18 +03:00
Matthew Kennedy b373c03db8
Lua script editor in console (#2699)
* stub

* implement reset

* console

* just use the console command

* cleanup

* s

* s

* ui

* write in chunks

* fix write

* tab size, script read

* parse script properly

* put lua script in flash, tiny for now

* generated fields
2021-05-18 20:58:39 +03:00
Matthew Kennedy 5a5f25244a
make the simulator usable (#2717)
* these start themselves now

* dead

* configure ports

* start serial

* dead

* minimal pins

* simulator logging works

* why not enable lua

* speeeeeed

* start lua

* spammy print
2021-05-17 12:44:02 +03:00
Matthew Kennedy 2abcd9d7ab
add ability to reset Lua interpreter (#2695)
* stub

* implement reset

* console

* just use the console command

* cleanup

* s

* s

* fix memory tracking
2021-05-14 16:20:27 -04:00
Matthew Kennedy 6cc7b0eeec
don't lowercase console commands (#2664)
* don't lowercase commands

* print bool lua results

* lua memory command
2021-05-10 11:30:50 -04:00
rusefillc 540bb8e327 Revert "lua on f407 (#2646)"
This reverts commit e8855263
2021-05-09 18:25:50 -04:00
Matthew Kennedy e885526308
lua on f407 (#2646)
* lua on f4

* move perf trace to efifeatures

* check that it's defined

* cypress and kinetis

* it would help to define the correct thing

* disable buffer if not used

* we can work with 2k

* turn off ramdisk on mre qc

* wow strncpy is useless for truncated strings

* turn off for bootloader

* lto bootloader
2021-05-09 16:25:38 -04:00
Matthew Kennedy 9d4bd0d6fe
Lua debug channels (#2620)
* setdebug hook

* add debug mode

* memory size debug channel

* default script
2021-05-04 10:05:39 -04:00
Matthew Kennedy a62b7bedb2
use static buffer for lua heap, enable on f429 (#2619)
* static buffer for lua

* enable lua for 429
2021-05-04 01:03:17 -04:00
Matthew Kennedy 8ae8484dd9
interactive lua (#2614)
* interactive lua

* unnecessary pop

* print return value

* enable f7 lua

* match f7 chconf
2021-05-03 17:46:12 -04:00
Matthew Kennedy e386ad4b38
Lua tick rate hook (#2606)
* implement setTickRate

* actually load the hook
2021-04-29 22:22:31 -04:00
Matthew Kennedy 5e66e8cb21
encapsulate in smart pointer (#2603)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-29 07:44:32 -04:00
Matthew Kennedy 830575a306
lua 5.4 (#2590)
* thread priority

* build

* makefile prep

* call startup

* lua 5.1

* mk

* 5.3

* mk

* I guess lua does something?

* extract hooks, builds for tests

* a bit of error handling

* guard

* bootloader makefile

* remove lua

* submodule

* submodule update

* builds with submodule

* disabled by default

* h7 chconf

* tweaks

* add a useful hook

* move luaconf

* perf trace lua

* test helpers

* lua unit tests

* include to satiate clang
2021-04-28 22:41:25 -04:00