Skip to content

Commit b61214c

Browse files
authored
Merge branch 'master' into ethernet_compat_layer
2 parents 3dd7113 + 9db4a4b commit b61214c

23 files changed

+1255
-116
lines changed

.github/workflows/lib.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ jobs:
125125
#Upload PR number as artifact
126126
upload-pr-number:
127127
name: Upload PR number
128-
if: github.event_name == 'pull_request'
128+
if: (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'lib_test'))
129129
runs-on: ubuntu-latest
130130
steps:
131131
- name: Save the PR number in an artifact
Lines changed: 51 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,64 @@
1+
# This needs to be in a separate workflow because it requires higher permissions than the calling workflow
12
name: Report Pre-commit Check Status
23

34
on:
4-
pull_request_target:
5-
types: [opened, reopened, synchronize, labeled, unlabeled]
5+
workflow_run:
6+
workflows: [Pre-commit hooks]
7+
types:
8+
- completed
69

710
permissions:
811
statuses: write
912

1013
jobs:
11-
report-run:
12-
name: Check if the PR has run the pre-commit checks
14+
report-success:
15+
name: Report pre-commit success
16+
if: github.event.workflow_run.conclusion == 'success'
1317
runs-on: ubuntu-latest
1418
steps:
15-
- name: Report pending
16-
uses: conda/actions/set-commit-status@v24.2.0
17-
with:
18-
context: "Pre-commit checks"
19-
state: pending
20-
description: The pre-commit checks need to be successful before merging
21-
22-
- name: Wait for pre-commit checks to complete
23-
uses: lucasssvaz/wait-on-workflow@v1
24-
if: |
25-
contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge')
26-
id: wait-on-workflow
19+
- name: Report success
20+
uses: actions/github-script@v7
2721
with:
28-
timeout: 10
29-
interval: 30
30-
workflow: pre-commit.yml
31-
sha: ${{ github.event.pull_request.head.sha || github.sha }}
22+
script: |
23+
const owner = '${{ github.repository_owner }}';
24+
const repo = '${{ github.repository }}'.split('/')[1];
25+
const sha = '${{ github.event.workflow_run.head_sha }}';
26+
core.debug(`owner: ${owner}`);
27+
core.debug(`repo: ${repo}`);
28+
core.debug(`sha: ${sha}`);
29+
const { context: name, state } = (await github.rest.repos.createCommitStatus({
30+
context: 'Pre-commit checks',
31+
description: 'Pre-commit checks successful',
32+
owner: owner,
33+
repo: repo,
34+
sha: sha,
35+
state: 'success',
36+
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}'
37+
})).data;
38+
core.info(`${name} is ${state}`);
3239
33-
- name: Report success
34-
uses: conda/actions/set-commit-status@v24.2.0
35-
if: |
36-
contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge') &&
37-
steps.wait-on-workflow.outputs.conclusion == 'success'
40+
report-pending:
41+
name: Report pre-commit pending
42+
if: github.event.workflow_run.conclusion != 'success'
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Report pending
46+
uses: actions/github-script@v7
3847
with:
39-
context: "Pre-commit checks"
40-
state: success
41-
description: All pre-commit checks passed
48+
script: |
49+
const owner = '${{ github.repository_owner }}';
50+
const repo = '${{ github.repository }}'.split('/')[1];
51+
const sha = '${{ github.event.workflow_run.head_sha }}';
52+
core.debug(`owner: ${owner}`);
53+
core.debug(`repo: ${repo}`);
54+
core.debug(`sha: ${sha}`);
55+
const { context: name, state } = (await github.rest.repos.createCommitStatus({
56+
context: 'Pre-commit checks',
57+
description: 'The pre-commit checks need to be successful before merging',
58+
owner: owner,
59+
repo: repo,
60+
sha: sha,
61+
state: 'pending',
62+
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}'
63+
})).data;
64+
core.info(`${name} is ${state}`);

.github/workflows/pre-commit.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
name: Pre-commit hooks
22

33
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
48
pull_request:
59
types: [opened, reopened, synchronize, labeled, unlabeled]
610

11+
concurrency:
12+
group: pre-commit-${{github.event.pull_request.number || github.ref}}
13+
cancel-in-progress: true
14+
715
jobs:
816
lint:
917
if: |
10-
contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge')
18+
contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge') ||
19+
github.event_name != 'pull_request'
1120
name: Check if fixes are needed
1221
runs-on: ubuntu-latest
1322
steps:
@@ -57,6 +66,7 @@ jobs:
5766

5867
- name: Push changes using pre-commit-ci-lite
5968
uses: pre-commit-ci/lite-action@v1.0.2
60-
if: always()
69+
# Only push changes in PRs
70+
if: ${{ always() && github.event_name == 'pull_request' }}
6171
with:
6272
msg: "ci(pre-commit): Apply automatic fixes"

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ set(ARDUINO_ALL_LIBRARIES
9595
LittleFS
9696
NetBIOS
9797
Network
98+
PPP
9899
Preferences
99100
RainMaker
100101
SD_MMC
@@ -159,6 +160,10 @@ set(ARDUINO_LIBRARY_LittleFS_SRCS libraries/LittleFS/src/LittleFS.cpp)
159160

160161
set(ARDUINO_LIBRARY_NetBIOS_SRCS libraries/NetBIOS/src/NetBIOS.cpp)
161162

163+
set(ARDUINO_LIBRARY_PPP_SRCS
164+
libraries/PPP/src/PPP.cpp
165+
libraries/PPP/src/ppp.c)
166+
162167
set(ARDUINO_LIBRARY_Preferences_SRCS libraries/Preferences/src/Preferences.cpp)
163168

164169
set(ARDUINO_LIBRARY_RainMaker_SRCS

Kconfig.projbuild

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,16 @@ config ARDUINO_SELECTIVE_Networking
321321
depends on ARDUINO_SELECTIVE_COMPILATION
322322
default y
323323

324+
config ARDUINO_SELECTIVE_Ethernet
325+
bool "Enable Ethernet"
326+
depends on ARDUINO_SELECTIVE_COMPILATION
327+
default y
328+
329+
config ARDUINO_SELECTIVE_PPP
330+
bool "Enable PPP"
331+
depends on ARDUINO_SELECTIVE_COMPILATION
332+
default y
333+
324334
config ARDUINO_SELECTIVE_ArduinoOTA
325335
bool "Enable ArduinoOTA"
326336
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Networking

cores/esp32/esp32-hal-adc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ static uint8_t __adcContinuousAtten = ADC_11db;
360360
static uint8_t __adcContinuousWidth = SOC_ADC_DIGI_MAX_BITWIDTH;
361361

362362
static uint8_t used_adc_channels = 0;
363-
adc_continuos_data_t *adc_result = NULL;
363+
adc_continuous_data_t *adc_result = NULL;
364364

365365
static bool adcContinuousDetachBus(void *adc_unit_number) {
366366
adc_unit_t adc_unit = (adc_unit_t)adc_unit_number - 1;
@@ -537,7 +537,7 @@ bool analogContinuous(uint8_t pins[], size_t pins_count, uint32_t conversions_pe
537537
}
538538

539539
//Allocate and prepare result structure for adc readings
540-
adc_result = malloc(pins_count * sizeof(adc_continuos_data_t));
540+
adc_result = malloc(pins_count * sizeof(adc_continuous_data_t));
541541
for (int k = 0; k < pins_count; k++) {
542542
adc_result[k].pin = pins[k];
543543
adc_result[k].channel = channel[k];
@@ -578,7 +578,7 @@ bool analogContinuous(uint8_t pins[], size_t pins_count, uint32_t conversions_pe
578578
return true;
579579
}
580580

581-
bool analogContinuousRead(adc_continuos_data_t **buffer, uint32_t timeout_ms) {
581+
bool analogContinuousRead(adc_continuous_data_t **buffer, uint32_t timeout_ms) {
582582
if (adc_handle[ADC_UNIT_1].adc_continuous_handle != NULL) {
583583
uint32_t bytes_read = 0;
584584
uint32_t read_raw[used_adc_channels];

cores/esp32/esp32-hal-adc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ extern "C" {
8686
uint8_t channel; /*!<ADC channel */
8787
int avg_read_raw; /*!<ADC average raw data */
8888
int avg_read_mvolts; /*!<ADC average voltage in mV */
89-
} adc_continuos_data_t;
89+
} adc_continuous_data_t;
9090

9191
/*
9292
* Setup ADC continuous peripheral
@@ -96,7 +96,7 @@ extern "C" {
9696
/*
9797
* Read ADC continuous conversion data
9898
* */
99-
bool analogContinuousRead(adc_continuos_data_t** buffer, uint32_t timeout_ms);
99+
bool analogContinuousRead(adc_continuous_data_t** buffer, uint32_t timeout_ms);
100100

101101
/*
102102
* Start ADC continuous conversions

cores/esp32/esp32-hal-periman.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ const char* perimanGetTypeName(peripheral_bus_type_t type) {
104104
case ESP32_BUS_TYPE_ETHERNET_MCD: return "ETHERNET_MCD";
105105
case ESP32_BUS_TYPE_ETHERNET_MDIO: return "ETHERNET_MDIO";
106106
case ESP32_BUS_TYPE_ETHERNET_PWR: return "ETHERNET_PWR";
107+
#endif
108+
#if CONFIG_LWIP_PPP_SUPPORT
109+
case ESP32_BUS_TYPE_PPP_TX: return "PPP_MODEM_TX";
110+
case ESP32_BUS_TYPE_PPP_RX: return "PPP_MODEM_RX";
111+
case ESP32_BUS_TYPE_PPP_RTS: return "PPP_MODEM_RTS";
112+
case ESP32_BUS_TYPE_PPP_CTS: return "PPP_MODEM_CTS";
107113
#endif
108114
default: return "UNKNOWN";
109115
}

cores/esp32/esp32-hal-periman.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ extern "C" {
102102
ESP32_BUS_TYPE_ETHERNET_MCD, // IO is used as ETHERNET MCD pin
103103
ESP32_BUS_TYPE_ETHERNET_MDIO, // IO is used as ETHERNET MDIO pin
104104
ESP32_BUS_TYPE_ETHERNET_PWR, // IO is used as ETHERNET PWR pin
105+
#endif
106+
#if CONFIG_LWIP_PPP_SUPPORT
107+
ESP32_BUS_TYPE_PPP_TX, // IO is used as PPP Modem TX pin
108+
ESP32_BUS_TYPE_PPP_RX, // IO is used as PPP Modem RX pin
109+
ESP32_BUS_TYPE_PPP_RTS, // IO is used as PPP Modem RTS pin
110+
ESP32_BUS_TYPE_PPP_CTS, // IO is used as PPP Modem CTS pin
105111
#endif
106112
ESP32_BUS_TYPE_MAX
107113
} peripheral_bus_type_t;

docs/en/api/adc.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ If ``false`` is returned, error occurs and ADC continuous was not configured.
184184
analogContinuousRead
185185
^^^^^^^^^^^^^^^^^^^^
186186

187-
This function is used to read ADC continuous data to the result buffer. The result buffer is an array of ``adc_continuos_data_t``.
187+
This function is used to read ADC continuous data to the result buffer. The result buffer is an array of ``adc_continuous_data_t``.
188188

189189
.. code-block:: arduino
190190
@@ -193,13 +193,13 @@ This function is used to read ADC continuous data to the result buffer. The resu
193193
uint8_t channel; /*!<ADC channel */
194194
int avg_read_raw; /*!<ADC average raw data */
195195
int avg_read_mvolts; /*!<ADC average voltage in mV */
196-
} adc_continuos_data_t;
196+
} adc_continuous_data_t;
197197
198198
.. code-block:: arduino
199199
200-
bool analogContinuousRead(adc_continuos_data_t ** buffer, uint32_t timeout_ms);
200+
bool analogContinuousRead(adc_continuous_data_t ** buffer, uint32_t timeout_ms);
201201
202-
* ``buffer`` conversion result buffer to read from ADC in adc_continuos_data_t format.
202+
* ``buffer`` conversion result buffer to read from ADC in adc_continuous_data_t format.
203203
* ``timeout_ms`` time to wait for data in milliseconds.
204204

205205
This function will return ``true`` if reading is successful and ``buffer`` is filled with data.

idf_component.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ dependencies:
4545
idf: ">=5.1"
4646
# mdns 1.2.1 is necessary to build H2 with no WiFi
4747
mdns: "^1.2.3"
48+
espressif/esp_modem: "^1.1.0"
4849
chmorgan/esp-libhelix-mp3:
4950
version: "1.0.3"
5051
require: public

libraries/ESP32/examples/AnalogReadContinuous/AnalogReadContinuous.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ uint8_t adc_pins_count = sizeof(adc_pins) / sizeof(uint8_t);
1616
volatile bool adc_coversion_done = false;
1717

1818
// Result structure for ADC Continuous reading
19-
adc_continuos_data_t* result = NULL;
19+
adc_continuous_data_t* result = NULL;
2020

2121
// ISR Function that will be triggered when ADC conversion is done
2222
void ARDUINO_ISR_ATTR adcComplete() {

libraries/Network/src/NetworkEvents.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -319,16 +319,14 @@ const char *NetworkEvents::eventName(arduino_event_id_t id) {
319319
case ARDUINO_EVENT_ETH_DISCONNECTED: return "ETH_DISCONNECTED";
320320
case ARDUINO_EVENT_ETH_GOT_IP: return "ETH_GOT_IP";
321321
case ARDUINO_EVENT_ETH_LOST_IP: return "ETH_LOST_IP";
322-
case ARDUINO_EVENT_ETH_GOT_IP6:
323-
return "ETH_GOT_IP6";
324-
325-
// case ARDUINO_EVENT_PPP_START: return "PPP_START";
326-
// case ARDUINO_EVENT_PPP_STOP: return "PPP_STOP";
327-
// case ARDUINO_EVENT_PPP_CONNECTED: return "PPP_CONNECTED";
328-
// case ARDUINO_EVENT_PPP_DISCONNECTED: return "PPP_DISCONNECTED";
329-
// case ARDUINO_EVENT_PPP_GOT_IP: return "PPP_GOT_IP";
330-
// case ARDUINO_EVENT_PPP_LOST_IP: return "PPP_LOST_IP";
331-
// case ARDUINO_EVENT_PPP_GOT_IP6: return "PPP_GOT_IP6";
322+
case ARDUINO_EVENT_ETH_GOT_IP6: return "ETH_GOT_IP6";
323+
case ARDUINO_EVENT_PPP_START: return "PPP_START";
324+
case ARDUINO_EVENT_PPP_STOP: return "PPP_STOP";
325+
case ARDUINO_EVENT_PPP_CONNECTED: return "PPP_CONNECTED";
326+
case ARDUINO_EVENT_PPP_DISCONNECTED: return "PPP_DISCONNECTED";
327+
case ARDUINO_EVENT_PPP_GOT_IP: return "PPP_GOT_IP";
328+
case ARDUINO_EVENT_PPP_LOST_IP: return "PPP_LOST_IP";
329+
case ARDUINO_EVENT_PPP_GOT_IP6: return "PPP_GOT_IP6";
332330
#if SOC_WIFI_SUPPORTED
333331
case ARDUINO_EVENT_WIFI_OFF: return "WIFI_OFF";
334332
case ARDUINO_EVENT_WIFI_READY: return "WIFI_READY";

libraries/Network/src/NetworkEvents.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ typedef enum {
7878
ARDUINO_EVENT_PROV_CRED_FAIL,
7979
ARDUINO_EVENT_PROV_CRED_SUCCESS,
8080
#endif
81-
// ARDUINO_EVENT_PPP_START,
82-
// ARDUINO_EVENT_PPP_STOP,
83-
// ARDUINO_EVENT_PPP_CONNECTED,
84-
// ARDUINO_EVENT_PPP_DISCONNECTED,
85-
// ARDUINO_EVENT_PPP_GOT_IP,
86-
// ARDUINO_EVENT_PPP_LOST_IP,
87-
// ARDUINO_EVENT_PPP_GOT_IP6,
81+
ARDUINO_EVENT_PPP_START,
82+
ARDUINO_EVENT_PPP_STOP,
83+
ARDUINO_EVENT_PPP_CONNECTED,
84+
ARDUINO_EVENT_PPP_DISCONNECTED,
85+
ARDUINO_EVENT_PPP_GOT_IP,
86+
ARDUINO_EVENT_PPP_LOST_IP,
87+
ARDUINO_EVENT_PPP_GOT_IP6,
8888
ARDUINO_EVENT_MAX
8989
} arduino_event_id_t;
9090

@@ -146,6 +146,7 @@ class NetworkEvents {
146146

147147
friend class ESP_NetworkInterface;
148148
friend class ETHClass;
149+
friend class PPPClass;
149150
#if SOC_WIFI_SUPPORTED
150151
friend class STAClass;
151152
friend class APClass;

0 commit comments

Comments
 (0)