Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-pico
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-pico
Commits
972b7f53
Unverified
Commit
972b7f53
authored
Feb 11, 2024
by
Earle F. Philhower, III
Committed by
GitHub
Feb 11, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix warning in lwip_ESPHost, add to styler (#1998)
parent
fc894fba
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
26 deletions
+35
-26
libraries/lwIP_ESPHost/src/ESPHost.cpp
libraries/lwIP_ESPHost/src/ESPHost.cpp
+14
-14
libraries/lwIP_ESPHost/src/ESPHost.h
libraries/lwIP_ESPHost/src/ESPHost.h
+1
-1
libraries/lwIP_ESPHost/src/lwIP_ESPHost.cpp
libraries/lwIP_ESPHost/src/lwIP_ESPHost.cpp
+18
-9
libraries/lwIP_ESPHost/src/lwIP_ESPHost.h
libraries/lwIP_ESPHost/src/lwIP_ESPHost.h
+1
-1
tests/restyle.sh
tests/restyle.sh
+1
-1
No files found.
libraries/lwIP_ESPHost/src/ESPHost.cpp
View file @
972b7f53
/*
WiFi <-> LWIP for ESPHost library in RP2040 Core
WiFi <-> LWIP for ESPHost library in RP2040 Core
Copyright (c) 2024 Juraj Andrassy
Copyright (c) 2024 Juraj Andrassy
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "ESPHost.h"
#include "CEspControl.h"
...
...
libraries/lwIP_ESPHost/src/ESPHost.h
View file @
972b7f53
...
...
@@ -16,7 +16,7 @@
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
#pragma once
...
...
libraries/lwIP_ESPHost/src/lwIP_ESPHost.cpp
View file @
972b7f53
...
...
@@ -95,14 +95,16 @@ int ESPHostLwIP::disconnectEventCb(CCtrlMsgWrapper *resp) {
}
bool
ESPHostLwIP
::
initHW
()
{
if
(
wifiHwInitialized
)
if
(
wifiHwInitialized
)
{
return
true
;
}
instance
=
this
;
CEspControl
::
getInstance
().
listenForStationDisconnectEvent
(
disconnectEventCb
);
CEspControl
::
getInstance
().
listenForInitEvent
(
initEventCb
);
if
(
CEspControl
::
getInstance
().
initSpiDriver
()
!=
0
)
if
(
CEspControl
::
getInstance
().
initSpiDriver
()
!=
0
)
{
return
false
;
}
uint32_t
start
=
millis
();
while
(
!
wifiHwInitialized
&&
(
millis
()
-
start
<
timeout
))
{
...
...
@@ -117,8 +119,9 @@ bool ESPHostLwIP::initHW() {
}
bool
ESPHostLwIP
::
begin
()
{
if
(
!
initHW
())
if
(
!
initHW
())
{
return
false
;
}
ethernet_arch_lwip_begin
();
if
(
!
apMode
)
{
CEspControl
::
getInstance
().
setWifiMode
(
WIFI_MODE_STA
);
...
...
@@ -131,7 +134,7 @@ bool ESPHostLwIP::begin() {
}
else
{
CEspControl
::
getInstance
().
setWifiMode
(
WIFI_MODE_AP
);
if
(
softAP
.
channel
==
0
||
softAP
.
channel
>
MAX_CHNL_NO
)
{
softAP
.
channel
=
1
;
softAP
.
channel
=
1
;
}
softAP
.
max_connections
=
MAX_SOFTAP_CONNECTION_DEF
;
softAP
.
encryption_mode
=
softAP
.
pwd
[
0
]
==
0
?
WIFI_AUTH_OPEN
:
WIFI_AUTH_WPA_WPA2_PSK
;
...
...
@@ -198,8 +201,9 @@ uint8_t ESPHostLwIP::status() {
}
uint8_t
*
ESPHostLwIP
::
macAddress
(
bool
apMode
,
uint8_t
*
mac
)
{
if
(
!
initHW
())
if
(
!
initHW
())
{
return
mac
;
}
WifiMac_t
MAC
;
MAC
.
mode
=
apMode
?
WIFI_MODE_AP
:
WIFI_MODE_STA
;
ethernet_arch_lwip_begin
();
...
...
@@ -220,8 +224,9 @@ int ESPHostLwIP::channel() {
}
int32_t
ESPHostLwIP
::
RSSI
()
{
if
(
!
joined
)
if
(
!
joined
)
{
return
0
;
}
ethernet_arch_lwip_begin
();
CEspControl
::
getInstance
().
getAccessPointConfig
(
ap
);
ethernet_arch_lwip_end
();
...
...
@@ -254,15 +259,18 @@ uint8_t ESPHostLwIP::encryptionType() {
}
int8_t
ESPHostLwIP
::
scanNetworks
(
bool
async
)
{
(
void
)
async
;
accessPoints
.
clear
();
if
(
!
initHW
())
if
(
!
initHW
())
{
return
-
1
;
}
ethernet_arch_lwip_begin
();
int
res
=
CEspControl
::
getInstance
().
getAccessPointScanList
(
accessPoints
);
ethernet_arch_lwip_end
();
wifiStatus
=
WL_SCAN_COMPLETED
;
if
(
res
!=
ESP_CONTROL_OK
)
if
(
res
!=
ESP_CONTROL_OK
)
{
return
-
1
;
}
return
accessPoints
.
size
();
}
...
...
@@ -310,8 +318,9 @@ int32_t ESPHostLwIP::RSSI(uint8_t networkItem) {
}
void
ESPHostLwIP
::
lowPowerMode
()
{
if
(
!
initHW
())
if
(
!
initHW
())
{
return
;
}
ethernet_arch_lwip_begin
();
CEspControl
::
getInstance
().
setPowerSaveMode
(
1
);
ethernet_arch_lwip_end
();
...
...
libraries/lwIP_ESPHost/src/lwIP_ESPHost.h
View file @
972b7f53
...
...
@@ -16,7 +16,7 @@
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
#pragma once
...
...
tests/restyle.sh
View file @
972b7f53
...
...
@@ -14,7 +14,7 @@ for dir in ./cores/rp2040 ./libraries/EEPROM ./libraries/I2S ./libraries/SingleF
./libraries/MouseBT ./libraries/SerialBT ./libraries/HID_Bluetooth
\
./libraries/JoystickBLE ./libraries/KeyboardBLE ./libraries/MouseBLE
\
./libraries/lwIP_w5500 ./libraries/lwIP_w5100 ./libraries/lwIP_enc28j60
\
./libraries/SPISlave
;
do
./libraries/SPISlave
./libraries/lwIP_ESPHost
;
do
find
$dir
-type
f
\(
-name
"*.c"
-o
-name
"*.h"
-o
-name
"*.cpp"
\)
-a
\!
-path
'*api*'
-exec
astyle
--suffix
=
none
--options
=
./tests/astyle_core.conf
\{\}
\;
find
$dir
-type
f
-name
"*.ino"
-exec
astyle
--suffix
=
none
--options
=
./tests/astyle_examples.conf
\{\}
\;
done
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment