Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 2026-04-21

### Added
- 🛣️ Multi UART streamer example

### Changed
- 🔆 Main `jescore` version 2.3.0
- ⛏️ Set `tool-esptoolpy` to version 1.40501.0 because the newest is broken (?)

## 2025-11-21

### Added
Expand Down
2 changes: 2 additions & 0 deletions lib/utils/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ extern "C" {

#include <inttypes.h>

void formatFloat(float value, uint8_t decimal_places, char *out_str);

#ifdef __cplusplus
}
#endif
26 changes: 25 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ upload_speed = 921600
monitor_speed = 115200
build_src_filter = -<*>
lib_deps =
jescore
jescore@^2.3.0
lib_ignore = lib/*
; ---------- BASE ENV ----------

; ++++++++++ ESP32 BOARDS ++++++++++
[_env:esp32]
extends = _env_base
platform = espressif32
platform_packages = tool-esptoolpy@~1.40501.0

[_env:esp32-arduino]
extends = _env:esp32
Expand Down Expand Up @@ -85,6 +86,28 @@ extends = _env:esp32-nodemcu-arduino
build_src_filter = +<hello_world_arduino.cpp>
; --- Hello World ---

; +++ Multi UART Streamer +++
[env:multi_uart_streamer_esp32-c3-arduino]
extends = _env:esp32-c3-arduino
build_src_filter = +<multi_uart_streamer_arduino.cpp>
lib_deps = jesdev-io/jescore@^2.2.3

[env:multi_uart_streamer_esp32-az-delivery-devkit-v4-arduino]
extends = _env:esp32-az-delivery-devkit-v4-arduino
build_src_filter = +<multi_uart_streamer_arduino.cpp>
lib_deps = jesdev-io/jescore@^2.2.3

[env:multi_uart_streamer_esp32-wrover-kit-arduino]
extends = _env:esp32-wrover-kit-arduino
build_src_filter = +<multi_uart_streamer_arduino.cpp>
lib_deps = jesdev-io/jescore@^2.2.3

[env:multi_uart_streamer_esp32-nodemcu-arduino]
extends = _env:esp32-nodemcu-arduino
build_src_filter = +<multi_uart_streamer_arduino.cpp>
lib_deps = jesdev-io/jescore@^2.2.3
; --- Multi UART Streamer ---

; +++ Sync-Async +++
[env:sync_async_esp32-c3-arduino]
extends = _env:esp32-c3-arduino
Expand Down Expand Up @@ -123,6 +146,7 @@ extends = _env:nucleol432kc-cube
lib_ignore =
${_env_base.lib_ignore}
!lib/port_stereo_spl_meter_stm32
!lib/utils
build_src_filter = +<stereo_spl_meter_nucleol432kc.c>
; --- Stereo SPL Meter ---

Expand Down
2 changes: 1 addition & 1 deletion src/fsm_cli_arduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void setup() {
jes_init();
pinMode(LED_PIN, OUTPUT);
analogWrite(LED_PIN, 255);
jes_register_job("lights", 2048, 1, lights, false);
jes_register_job("lights", 2048, 1, lights, 0, 0);
}

void loop() {
Expand Down
4 changes: 2 additions & 2 deletions src/hello_world_arduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ void hello(void* p){
void setup(){
pinMode(LED_PIN, OUTPUT);
jes_init();
jes_register_and_launch_job("blink", 1024, 1, blink, 1);
jes_register_job("hello", 1024, 1, hello, 0);
jes_register_and_launch_job("blink", 1024, 1, blink, 1, 0);
jes_register_job("hello", 1024, 1, hello, 0, 0);
}

void loop(){
Expand Down
4 changes: 2 additions & 2 deletions src/hello_world_nucleol432kc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ int main(void){
MX_GPIO_Init();

jes_init();
jes_register_and_launch_job("blink", 256, 1, blink, 1);
jes_register_job("hello", 256, 1, hello, 0);
jes_register_and_launch_job("blink", 256, 1, blink, 1, 0);
jes_register_job("hello", 256, 1, hello, 0, 0);
jes_dispatch();
}

Expand Down
55 changes: 55 additions & 0 deletions src/multi_uart_streamer_arduino.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
This code demonstrates how jescore can split UART messages
originating from different jobs. This is very useful for
debugging and low rate cross-platform data transfer.

jescore CLI:
- Call `jescore -l` to see all jobs printing
- Call `jescore -l --filter [printer1]` to just see the output
of the job "printer1"
- Call `jescore -l --filter [printer1, printer2]` to see the
output of both "printer1" and "printer2"
- Call `jescore hello` to see the response of the "hello" job,
where the name of the job is directly applied as filter
*/

#include <Arduino.h>
#include <jescore.h>

void printer1(void* p){
while(1){
jes_print("Hello from printer 1!\n\r");
jes_delay_job_ms(1000);
}
}

void printer2(void* p){
while(1){
jes_print("Hello from printer 2!\n\r");
jes_delay_job_ms(2000);
}
}

void printer3(void* p){
while(1){
jes_print("Hello from printer 3!\n\r");
jes_delay_job_ms(3000);
}
}

void printer_on_demand(void* p){
jes_print("Hello on demand!\n\r");
}


void setup() {
jes_init();
jes_register_and_launch_job("printer1", 2048, 1, printer1, 1, 1);
jes_register_and_launch_job("printer2", 2048, 1, printer2, 1, 1);
jes_register_and_launch_job("printer3", 2048, 1, printer3, 1, 1);
jes_register_job("hello", 2048, 1, printer_on_demand, 0, 1);
}

void loop() {

}
4 changes: 2 additions & 2 deletions src/stereo_spl_meter_nucleol432kc.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ void audio_controller(void* p) {
/// @param p `jescore` job pointer.
void port_setup(){
jes_init();
jes_register_and_launch_job("_audio", 2048, 1, audio_loop, 1);
jes_register_job("audio", 1024, 1, audio_controller, 0);
jes_register_and_launch_job("_audio", 2048, 1, audio_loop, 1, 1);
jes_register_job("audio", 1024, 1, audio_controller, 0, 1);
LED_ENABLE_PORT();
HAL_StatusTypeDef stat;
if ((stat = HAL_SAI_Receive_DMA(&hsai_BlockA1, (uint8_t*)mem, BLOCK_SIZE*2)) != HAL_OK){
Expand Down
4 changes: 2 additions & 2 deletions src/sync_async_arduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ void blink_switch(void* p){
void setup() {
jes_init();
pinMode(LED_PIN, OUTPUT);
jes_register_job("switch", 2048, 1, blink_switch, false);
jes_register_and_launch_job("blink", 2048, 1, blink_forever, true);
jes_register_job("switch", 2048, 1, blink_switch, 0, 1);
jes_register_and_launch_job("blink", 2048, 1, blink_forever, 1, 1);
}

void loop() {
Expand Down
Loading