Skip to content

Commit

Permalink
Merge remote-tracking branch 'ewowi/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
ewoudwijma committed Jul 5, 2024
2 parents 06b69c6 + 904212b commit 5921693
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 9 deletions.
37 changes: 37 additions & 0 deletions misc/blink.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
external void show();
external void pinMode(uint8_t pin, uint8_t mode);
external void digitalWrite(uint8_t pin, uint8_t val);
external void delay(uint32_t ms);
//external void pinsM->allocatePin(unsigned8 pinNr, const char * owner, const char * details); //classes supported?

//how to deal with external defines?
define OUTPUT 0x03
define LOW 0x0
define HIGH 0x1

uint8_t blinkPin; //tbd: assigment here

void setup()
{
blinkPin = 5; //tbd make blinkPin an ui control

//pinsM->allocatePin(2, "Blink", "On board led"); //class methods and strings supported?
pinMode(blinkPin, OUTPUT); //tbd: part of allocatePin?
}

void loop() {
digitalWrite(blinkPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(blinkPin, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

void main()
{
setup();
while (0==0)
{
loop();
show();
}
}
26 changes: 17 additions & 9 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,29 @@
; @license For non GPL-v3 usage, commercial licenses must be purchased. Contact [email protected]



; ESPAsyncWebServer ESPHome version
[ESPAsyncWebServer]
build_flags =
-D CONFIG_ASYNC_TCP_USE_WDT=0 ;why? tbd: experiment without
-D WS_MAX_QUEUED_MESSAGES=64
-D CONFIG_ASYNC_TCP_RUNNING_CORE=1 ;tbd experiment without
;-D CONFIG_ASYNC_TCP_TASK_STACK_SIZE ; 8192*2 here as default !!!
lib_deps =
; https://github.com/pbolduc/AsyncTCP.git @ 1.2.0 ; WLEDMM this must be first in the list, otherwise Aircoookie/ESPAsyncWebServer pulls in an older version of AsyncTCP !!
; https://github.com/ewoudwijma/ESPAsyncWebServer.git#v2.0.7
; https://github.com/aircoookie/ESPAsyncWebServer.git @ 2.2.1
; https://github.com/ewowi/ESPAsyncWebServer.git ;me-no-dev + 64 + queueLength - alternative
; https://github.com/lost-hope/ESPAsyncWebServer.git#master ;artifx on <ip>/edit
; https://github.com/esphome/ESPAsyncWebServer.git @ 3.2.2
https://github.com/MoonModules/ESPAsyncWebServer.git @ 3.2.2 ; + queueLength

; ESPAsyncWebServer AirCoookie v2.0.7 version (2.2.1 is latest)
; [ESPAsyncWebServer]
; build_flags =
; -D CONFIG_ASYNC_TCP_USE_WDT=0 ;why? tbd: experiment without
; ; -D WS_MAX_QUEUED_MESSAGES=64 ;not supported to set here in AirCoookie version
; -D CONFIG_ASYNC_TCP_STACK_SIZE=CONFIG_ASYNC_TCP_TASK_STACK_SIZE ; ESPHome uses CONFIG_ASYNC_TCP_STACK_SIZE (used in SysModSystem)
; lib_deps =
; ; https://github.com/lost-hope/ESPAsyncWebServer.git#master ;aircoookie + artifx on <ip>/edit
; ; https://github.com/ewowi/ESPAsyncWebServer.git ;me-no-dev + 64 + queueLength - alternative
; https://github.com/pbolduc/AsyncTCP.git @ 1.2.0 ; WLEDMM this must be first in the list, otherwise Aircoookie/ESPAsyncWebServer pulls in an older version of AsyncTCP !!
; https://github.com/ewoudwijma/ESPAsyncWebServer.git#v2.0.7 ;aircoookie + getClients + 64
; ; https://github.com/ewoudwijma/ESPAsyncWebServer.git#v2.2.1 ;crashes on ws refererence in sendDataWs !!


;Work in progress - not compiling yet
[PsychicHttp]
Expand Down Expand Up @@ -57,14 +65,14 @@ lib_deps =
build_flags =
-D STARBASE_USERMOD_LIVE
lib_deps =
https://github.com/hpwit/ASMParser.git
https://github.com/hpwit/ASMParser.git#memory
; about 1% / 19KB flash

[STARBASE]
build_flags =
; -D APP=StarBase
-D PIOENV=$PIOENV
-D VERSION=24062015 ; Date and time (GMT!), update at every commit!!
-D VERSION=24070509 ; Date and time (GMT!), update at every commit!!
-D LFS_THREADSAFE ; enables use of semaphores in LittleFS driver
-D STARBASE_DEVMODE
${ESPAsyncWebServer.build_flags} ;alternatively PsychicHttp
Expand Down
5 changes: 5 additions & 0 deletions src/User/UserModLive.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ static void show()
// RETURN_VALUE(VALUE_FROM_INT(0), rindex);
}


class UserModLive:public SysModule {

public:
Expand Down Expand Up @@ -120,6 +121,10 @@ class UserModLive:public SysModule {
addExternal("show", externalType::function, (void *)&show);
addExternal("showM", externalType::function, (void *)&UserModLive::showM); // warning: converting from 'void (UserModLive::*)()' to 'void*' [-Wpmf-conversions]

addExternal("pinMode", externalType::function, (void *)&pinMode);
addExternal("digitalWrite", externalType::function, (void *)&digitalWrite);
addExternal("delay", externalType::function, (void *)&delay);

}

//testing class functions instead of static
Expand Down

0 comments on commit 5921693

Please sign in to comment.