Skip to content

Commit 11cc856

Browse files
committed
Merge branch 'mega' into feature/esp-now-controller
2 parents 86fa8f1 + e8b21ce commit 11cc856

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1664
-803
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ concurrency:
2121

2222
jobs:
2323
documentation:
24-
runs-on: ubuntu-22.04
24+
runs-on: ubuntu-latest
2525
steps:
2626
- uses: actions/checkout@v4
2727
- uses: actions/setup-python@v5
@@ -45,7 +45,7 @@ jobs:
4545
name: Documentation
4646
path: ESPEasy_docs.zip
4747
generate-matrix:
48-
runs-on: ubuntu-22.04
48+
runs-on: ubuntu-latest
4949
outputs:
5050
matrix: ${{ steps.set-matrix.outputs.matrix }}
5151
steps:
@@ -60,7 +60,7 @@ jobs:
6060
6161
build:
6262
needs: generate-matrix
63-
runs-on: ubuntu-22.04
63+
runs-on: ubuntu-latest
6464
strategy:
6565
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
6666
steps:
@@ -116,7 +116,7 @@ jobs:
116116
# Package all ESP82xx and ESP32 into a single ESPEasy-all-Binaries-<date>_PR#<pr_nr>_<runnr>.zip
117117
combine_package:
118118
needs: build
119-
runs-on: ubuntu-22.04
119+
runs-on: ubuntu-latest
120120
steps:
121121
- uses: actions/checkout@v4
122122
- uses: actions/setup-python@v5

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions:
1717

1818
jobs:
1919
generate-matrix:
20-
runs-on: ubuntu-22.04
20+
runs-on: ubuntu-latest
2121
outputs:
2222
matrix: ${{ steps.set-matrix.outputs.matrix }}
2323
steps:
@@ -32,7 +32,7 @@ jobs:
3232
3333
build:
3434
needs: generate-matrix
35-
runs-on: ubuntu-22.04
35+
runs-on: ubuntu-latest
3636
strategy:
3737
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
3838
steps:
@@ -79,7 +79,7 @@ jobs:
7979

8080
prepare-dist:
8181
needs: build
82-
runs-on: ubuntu-22.04
82+
runs-on: ubuntu-latest
8383
steps:
8484
- uses: actions/checkout@v4
8585
- uses: actions/setup-python@v5
@@ -111,7 +111,7 @@ jobs:
111111
112112
prepare-notes:
113113
needs: build
114-
runs-on: ubuntu-22.04
114+
runs-on: ubuntu-latest
115115
outputs:
116116
notes: ${{ steps.release-notes.outputs.result }}
117117
steps:
@@ -136,7 +136,7 @@ jobs:
136136
permissions:
137137
contents: write # for ncipollo/release-action
138138
needs: [build, prepare-dist, prepare-notes]
139-
runs-on: ubuntu-22.04
139+
runs-on: ubuntu-latest
140140
steps:
141141
- uses: actions/setup-python@v5
142142
with:

docs/source/Plugin/P140.rst

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
.. include:: ../Plugin/_plugin_substitutions_p14x.repl
2+
.. _P140_page:
3+
4+
|P140_typename|
5+
==================================================
6+
7+
|P140_shortinfo|
8+
9+
Plugin details
10+
--------------
11+
12+
Type: |P140_type|
13+
14+
Name: |P140_name|
15+
16+
Status: |P140_status|
17+
18+
GitHub: |P140_github|_
19+
20+
Maintainer: |P140_maintainer|
21+
22+
Used libraries: |P140_usedlibraries|
23+
24+
Description
25+
-----------
26+
27+
M5Stack CardKB I2C ASCII input keyboard support.
28+
29+
Can be used to enter commands as if typing via USB serial to the device. It can also be used as input for a GUI, built using the AdaGFX_helper graphics commands, or a menu/button configuration via the Extended Touch panel, by handling the ``Key`` values in Rules.
30+
31+
Only printable ASCII characters (a-z, A-Z, 0-9, space and punctuation) will be appended to the input buffer. The ``Del`` key can be used for corrections (backspace), and ``Enter`` to submit the input. Other keys can be handled in Rules if **Send event on keypress** is enabled.
32+
33+
Configuration
34+
--------------
35+
36+
.. image:: P140_DeviceConfiguration.png
37+
:alt: Device configuration
38+
39+
* **Name** A unique name should be entered here.
40+
41+
* **Enabled** The device can be disabled or enabled. When not enabled the device should not use any resources.
42+
43+
I2C Options
44+
^^^^^^^^^^^^
45+
46+
The available settings here depend on the build used, and configuration options set. At least the **Force Slow I2C speed** option is available, but selections for the I2C Multiplexer can also be shown. For details see the :ref:`Hardware_page`
47+
48+
Device Settings
49+
^^^^^^^^^^^^^^^^
50+
51+
* **Execute input as command**: When enabled (default: On), input typed on the keyboard will be executed as a command when the ``Enter`` key is pressed, and corrections can be made by using the ``Del`` key, working as Backspace. When disabled, input will not be stored in the buffer (unless **Accept input only** is enabled), but should be handled in Rules by enabling **Send event on keypress**. After pressing ``Enter`` the buffer will be cleared.
52+
53+
* **Accept input only**: When enabled, it will accept input up until ``Enter`` is pressed, and *will send events* as if **Send event on keypress** was enabled. The buffer will also be cleared. If **Execute input as command** is also enabled, the input *is* also processed as a command. This is usually not the desired combination.
54+
55+
* **Send event on keypress**: When enabled will generate events with the ASCII code for the key. If **Execute input as command** or **Accept input only** are enabled, also the current buffer Length and Buffer content will be generated as events.
56+
57+
Buffer
58+
^^^^^^
59+
60+
If the plugin is enabled, the **Current buffer content** is shown in this section. The value will *not* be automatically updated when adding or deleting characters to/from the buffer while the page is open.
61+
62+
.. image:: P140_BufferContentExample.png
63+
64+
Data Acquisition
65+
^^^^^^^^^^^^^^^^
66+
67+
This group of settings, **Single event with all values** and **Send to Controller** settings are standard available configuration items. Send to Controller is only visible when one or more Controllers are configured.
68+
69+
**Interval** Is not available for this plugin, events will only be generated when the **Send event on keypress** setting is enabled, or **Accept input only** is enabled and ``Enter`` is pressed.
70+
71+
Values
72+
^^^^^^
73+
74+
The current values are available in ``Key``, ``Length`` and ``Buffer``, limited to ``Key`` if **Execute input as command** and **Accept input only** are disabled. No decimals, formula or charting options are available.
75+
76+
To handle ``Buffer`` in Rules completely, the event handler has to be decorated with an asterisk, ``*``, to enable the possible non-numeric content of the buffer to be passed to the event handler:
77+
78+
.. code:: none
79+
80+
On CardKB#Buffer* Do
81+
LogEntry,'CardKB: Current input buffer: %eventvalue1%'
82+
Endon
83+
84+
When enabling **Single event with all values**, this is't needed, as the first event argument ``Key`` will always be numeric.
85+
86+
.. code:: none
87+
88+
On CardKB#All Do
89+
LogEntry,'CardKB: Last key: %eventvalue1%, Length: %eventvalue2%, Input buffer: %eventvalue3%'
90+
Endon
91+
92+
When **Execute input as command** is enabled, the current buffer content is shown in the Devices overview page:
93+
94+
.. image:: P140_DevicesOverviewExample.png
95+
96+
(The buffer content is only quoted when needed, so it can be passed as a single argument to event handlers.)
97+
98+
Commands
99+
~~~~~~~~
100+
101+
.. include:: P140_commands.repl
102+
103+
104+
105+
Change log
106+
----------
107+
108+
.. versionchanged:: 2.0
109+
110+
|added| 2025-02-08 Initially added.
2.43 KB
Loading
41.6 KB
Loading
Loading

docs/source/Plugin/P140_commands.repl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.. csv-table::
2+
:header: "Command Syntax", "Extra information"
3+
:widths: 20, 30
4+
5+
"
6+
| ``CardKB,exec,<0|1>``
7+
","
8+
| Enable (``1``) or disable (``0``) the **Execute input as command** setting. Settings are not saved!
9+
"
10+
"
11+
| ``CardKB,input,<0|1>``
12+
","
13+
| Enable (``1``) or disable (``0``) the **Accept input only** setting. Settings are not saved!
14+
"
15+
"
16+
| ``CardKB,events,<0|1>``
17+
","
18+
| Enable (``1``) or disable (``0``) the **Send events on keypress** setting. Settings are not saved!
19+
"
20+
"
21+
| ``CardKB,clear``
22+
","
23+
| Will clear the current content of the buffer.
24+
"

docs/source/Plugin/_Plugin.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ There are different released versions of ESP Easy:
375375
":ref:`P137_page`","|P137_status|","P137"
376376
":ref:`P138_page`","|P138_status|","P138"
377377
":ref:`P139_page`","|P139_status|","P139"
378+
":ref:`P140_page`","|P140_status|","P140"
378379
":ref:`P141_page`","|P141_status|","P141"
379380
":ref:`P142_page`","|P142_status|","P142"
380381
":ref:`P143_page`","|P143_status|","P143"

docs/source/Plugin/_plugin_categories.repl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
.. |Plugin_Gyro| replace:: :ref:`P045_page`, :ref:`P119_page`
1717
.. |Plugin_Hardware| replace:: :ref:`P046_page`
1818
.. |Plugin_Input| replace:: :ref:`P129_page` :ref:`P170_page`
19-
.. |Plugin_Keypad| replace:: :ref:`P058_page`, :ref:`P061_page`, :ref:`P062_page`, :ref:`P063_page`
19+
.. |Plugin_Keypad| replace:: :ref:`P058_page`, :ref:`P061_page`, :ref:`P062_page`, :ref:`P063_page` :ref:`P140_page`
2020
.. |Plugin_Light_Color| replace:: :ref:`P050_page`, :ref:`P066_page`
2121
.. |Plugin_Light_UV| replace:: :ref:`P084_page`, :ref:`P107_page`, :ref:`P114_page`, :ref:`P133_page`
2222
.. |Plugin_Light_Lux| replace:: :ref:`P010_page`, :ref:`P015_page`, :ref:`P074_page`, :ref:`P168_page`

docs/source/Plugin/_plugin_substitutions_p14x.repl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
.. |P140_name| replace:: :cyan:`CardKB I2C Keyboard`
2+
.. |P140_type| replace:: :cyan:`Keypad`
3+
.. |P140_typename| replace:: :cyan:`Keypad - CardKB I2C Keyboard`
4+
.. |P140_porttype| replace:: `.`
5+
.. |P140_status| replace:: :yellow:`ESP32`
6+
.. |P140_github| replace:: P140_CardKB.ino
7+
.. _P140_github: https://github.com/letscontrolit/ESPEasy/blob/mega/src/_P140_CardKB.ino
8+
.. |P140_usedby| replace:: `.`
9+
.. |P140_shortinfo| replace:: `M5Stack CardKB I2C Keyboard`
10+
.. |P140_maintainer| replace:: `tonhuisman`
11+
.. |P140_compileinfo| replace:: `.`
12+
.. |P140_usedlibraries| replace:: `.`
13+
114
.. |P141_name| replace:: :cyan:`PCD8544 Nokia 5110 LCD`
215
.. |P141_type| replace:: :cyan:`Display`
316
.. |P141_typename| replace:: :cyan:`Display - PCD8544 Nokia 5110 LCD`

docs/source/Reference/Command.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,11 @@ P139 :ref:`P139_page`
768768

769769
.. include:: ../Plugin/P139_commands.repl
770770

771+
P140 :ref:`P140_page`
772+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
773+
774+
.. include:: ../Plugin/P140_commands.repl
775+
771776
P141 :ref:`P141_page`
772777
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
773778

platformio_esp32s3_envs.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ build_flags = ${esp32s3_common_LittleFS.build_flags}
217217
-DPLUGIN_BUILD_IR_EXTENDED
218218
-DCONFIG_PM_LIGHTSLEEP_RTC_OSC_CAL_INTERVAL=1
219219
extra_scripts = ${esp32s3_common_LittleFS.extra_scripts}
220-
custom_sdkconfig =
221-
CONFIG_RMT_ISR_CACHE_SAFE=y
222-
CONFIG_PM_LIGHTSLEEP_RTC_OSC_CAL_INTERVAL=1
220+
;custom_sdkconfig =
221+
; CONFIG_RMT_ISR_CACHE_SAFE=y
222+
; CONFIG_PM_LIGHTSLEEP_RTC_OSC_CAL_INTERVAL=1
223223

224224

225225

platformio_esp82xx_base.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ build_flags = ${beta_platform.build_flags}
107107
lib_ignore = ${beta_platform.lib_ignore}
108108
${no_ir.lib_ignore}
109109

110+
[normal_beta_2ndheap]
111+
platform = ${beta_platform_2ndheap.platform}
112+
platform_packages = ${beta_platform_2ndheap.platform_packages}
113+
build_flags = ${beta_platform_2ndheap.build_flags}
114+
-DBUILD_NO_DEBUG
115+
lib_ignore = ${beta_platform.lib_ignore}
116+
${no_ir.lib_ignore}
117+
110118
;;; COLLECTION ********************************************************
111119
; additional plugins (and dependend code) that is marked as COLLECTION ;
112120
; Includes "normal" + "collection" plugins ;

platformio_esp82xx_envs.ini

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,26 @@ build_flags = ${normal.build_flags}
300300
-D NO_LIMIT_BUILD_SIZE
301301
lib_ignore = ${normal.lib_ignore}
302302

303+
[env:normal_beta_2ndheap_ESP8266_4M1M]
304+
extends = esp8266_4M1M
305+
platform = ${normal_beta_2ndheap.platform}
306+
platform_packages = ${normal_beta_2ndheap.platform_packages}
307+
build_flags = ${normal_beta_2ndheap.build_flags}
308+
${esp8266_4M1M.build_flags}
309+
-D NO_LIMIT_BUILD_SIZE
310+
lib_ignore = ${normal_beta_2ndheap.lib_ignore}
311+
312+
313+
[env:normal_beta_2ndheap_ESP8266_4M1M_VCC]
314+
extends = esp8266_4M1M
315+
platform = ${normal_beta_2ndheap.platform}
316+
platform_packages = ${normal_beta_2ndheap.platform_packages}
317+
build_flags = ${normal_beta_2ndheap.build_flags}
318+
${esp8266_4M1M.build_flags}
319+
-D FEATURE_ADC_VCC=1
320+
-D NO_LIMIT_BUILD_SIZE
321+
lib_ignore = ${normal_beta_2ndheap.lib_ignore}
322+
303323

304324
; NORMAL: 16M version --- LittleFS --------------
305325
; LittleFS is determined by using "LittleFS" in the pio env name

src/Custom-sample.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ static const char DATA_ESPEASY_DEFAULT_MIN_CSS[] PROGMEM = {
407407
// #define USES_P041 // NeoPixel (Word Clock)
408408
// #define USES_P042 // NeoPixel (Candle)
409409
// #define USES_P043 // ClkOutput
410-
// #define USES_P044 // P1 Wifi Gateway
410+
// #define USES_P044 // P1 Wifi Gateway (Merged with P020, when P044 is enabled, then P020 is also enabled)
411411
// #define USES_P045 // MPU6050
412412
// #define USES_P046 // Ventus W266
413413
// #define USES_P047 // Soil moisture sensor
@@ -518,7 +518,10 @@ static const char DATA_ESPEASY_DEFAULT_MIN_CSS[] PROGMEM = {
518518
// #define P135_FEATURE_RESET_COMMANDS 1 // Enable/Disable quite spacious (~950 bytes) 'selftest' and 'factoryreset' subcommands
519519
// #define USES_P137 // AXP192
520520
// #define USES_P138 // IP5306
521+
// #define USES_P139 // AXP2101
521522

523+
// #define USES_P140 // CardKB
524+
// #define UN_USES_P140 // **DISABLE** I2C CardKB for ESP32 (Enabled by default for ESP32)
522525
// #define USES_P141 // PCD8544 Nokia 5110 LCD
523526
// #define USES_P142 // Position - AS5600
524527
// #define USES_P143 // I2C Rotary encoders
@@ -555,6 +558,7 @@ static const char DATA_ESPEASY_DEFAULT_MIN_CSS[] PROGMEM = {
555558
// #define USES_P173 // Environment - SHTC3
556559
// #define USES_P175 // Dust - PMSx003i I2C
557560
// #define USES_P176 // Communication - Victron VE.Direct
561+
// #define USES_P178 // LU9685 Servo controller
558562

559563
/*
560564
#######################################################################################################

src/_C001.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,14 @@ bool CPlugin_001(CPlugin::Function function, struct EventStruct *event, String&
100100
url += mapVccToDomoticz();
101101
# endif // if FEATURE_ADC_VCC
102102

103-
std::unique_ptr<C001_queue_element> element(new (std::nothrow) C001_queue_element(event->ControllerIndex, event->TaskIndex, std::move(url)));
103+
constexpr unsigned size = sizeof(C001_queue_element);
104+
void *ptr = special_calloc(1, size);
105+
106+
if (ptr != nullptr) {
107+
std::unique_ptr<C001_queue_element> element(new (ptr) C001_queue_element(event->ControllerIndex, event->TaskIndex, std::move(url)));
104108

105-
success = C001_DelayHandler->addToQueue(std::move(element));
109+
success = C001_DelayHandler->addToQueue(std::move(element));
110+
}
106111
Scheduler.scheduleNextDelayQueue(SchedulerIntervalTimer_e::TIMER_C001_DELAY_QUEUE,
107112
C001_DelayHandler->getNextScheduleTime());
108113
}

0 commit comments

Comments
 (0)