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
Show 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
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
You should have received a copy of the GNU Lesser General Public
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
#include "ESPHost.h"
#include "ESPHost.h"
#include "CEspControl.h"
#include "CEspControl.h"
...
...
libraries/lwIP_ESPHost/src/ESPHost.h
View file @
972b7f53
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
You should have received a copy of the GNU Lesser General Public
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
#pragma once
#pragma once
...
...
libraries/lwIP_ESPHost/src/lwIP_ESPHost.cpp
View file @
972b7f53
...
@@ -95,14 +95,16 @@ int ESPHostLwIP::disconnectEventCb(CCtrlMsgWrapper *resp) {
...
@@ -95,14 +95,16 @@ int ESPHostLwIP::disconnectEventCb(CCtrlMsgWrapper *resp) {
}
}
bool
ESPHostLwIP
::
initHW
()
{
bool
ESPHostLwIP
::
initHW
()
{
if
(
wifiHwInitialized
)
if
(
wifiHwInitialized
)
{
return
true
;
return
true
;
}
instance
=
this
;
instance
=
this
;
CEspControl
::
getInstance
().
listenForStationDisconnectEvent
(
disconnectEventCb
);
CEspControl
::
getInstance
().
listenForStationDisconnectEvent
(
disconnectEventCb
);
CEspControl
::
getInstance
().
listenForInitEvent
(
initEventCb
);
CEspControl
::
getInstance
().
listenForInitEvent
(
initEventCb
);
if
(
CEspControl
::
getInstance
().
initSpiDriver
()
!=
0
)
if
(
CEspControl
::
getInstance
().
initSpiDriver
()
!=
0
)
{
return
false
;
return
false
;
}
uint32_t
start
=
millis
();
uint32_t
start
=
millis
();
while
(
!
wifiHwInitialized
&&
(
millis
()
-
start
<
timeout
))
{
while
(
!
wifiHwInitialized
&&
(
millis
()
-
start
<
timeout
))
{
...
@@ -117,8 +119,9 @@ bool ESPHostLwIP::initHW() {
...
@@ -117,8 +119,9 @@ bool ESPHostLwIP::initHW() {
}
}
bool
ESPHostLwIP
::
begin
()
{
bool
ESPHostLwIP
::
begin
()
{
if
(
!
initHW
())
if
(
!
initHW
())
{
return
false
;
return
false
;
}
ethernet_arch_lwip_begin
();
ethernet_arch_lwip_begin
();
if
(
!
apMode
)
{
if
(
!
apMode
)
{
CEspControl
::
getInstance
().
setWifiMode
(
WIFI_MODE_STA
);
CEspControl
::
getInstance
().
setWifiMode
(
WIFI_MODE_STA
);
...
@@ -198,8 +201,9 @@ uint8_t ESPHostLwIP::status() {
...
@@ -198,8 +201,9 @@ uint8_t ESPHostLwIP::status() {
}
}
uint8_t
*
ESPHostLwIP
::
macAddress
(
bool
apMode
,
uint8_t
*
mac
)
{
uint8_t
*
ESPHostLwIP
::
macAddress
(
bool
apMode
,
uint8_t
*
mac
)
{
if
(
!
initHW
())
if
(
!
initHW
())
{
return
mac
;
return
mac
;
}
WifiMac_t
MAC
;
WifiMac_t
MAC
;
MAC
.
mode
=
apMode
?
WIFI_MODE_AP
:
WIFI_MODE_STA
;
MAC
.
mode
=
apMode
?
WIFI_MODE_AP
:
WIFI_MODE_STA
;
ethernet_arch_lwip_begin
();
ethernet_arch_lwip_begin
();
...
@@ -220,8 +224,9 @@ int ESPHostLwIP::channel() {
...
@@ -220,8 +224,9 @@ int ESPHostLwIP::channel() {
}
}
int32_t
ESPHostLwIP
::
RSSI
()
{
int32_t
ESPHostLwIP
::
RSSI
()
{
if
(
!
joined
)
if
(
!
joined
)
{
return
0
;
return
0
;
}
ethernet_arch_lwip_begin
();
ethernet_arch_lwip_begin
();
CEspControl
::
getInstance
().
getAccessPointConfig
(
ap
);
CEspControl
::
getInstance
().
getAccessPointConfig
(
ap
);
ethernet_arch_lwip_end
();
ethernet_arch_lwip_end
();
...
@@ -254,15 +259,18 @@ uint8_t ESPHostLwIP::encryptionType() {
...
@@ -254,15 +259,18 @@ uint8_t ESPHostLwIP::encryptionType() {
}
}
int8_t
ESPHostLwIP
::
scanNetworks
(
bool
async
)
{
int8_t
ESPHostLwIP
::
scanNetworks
(
bool
async
)
{
(
void
)
async
;
accessPoints
.
clear
();
accessPoints
.
clear
();
if
(
!
initHW
())
if
(
!
initHW
())
{
return
-
1
;
return
-
1
;
}
ethernet_arch_lwip_begin
();
ethernet_arch_lwip_begin
();
int
res
=
CEspControl
::
getInstance
().
getAccessPointScanList
(
accessPoints
);
int
res
=
CEspControl
::
getInstance
().
getAccessPointScanList
(
accessPoints
);
ethernet_arch_lwip_end
();
ethernet_arch_lwip_end
();
wifiStatus
=
WL_SCAN_COMPLETED
;
wifiStatus
=
WL_SCAN_COMPLETED
;
if
(
res
!=
ESP_CONTROL_OK
)
if
(
res
!=
ESP_CONTROL_OK
)
{
return
-
1
;
return
-
1
;
}
return
accessPoints
.
size
();
return
accessPoints
.
size
();
}
}
...
@@ -310,8 +318,9 @@ int32_t ESPHostLwIP::RSSI(uint8_t networkItem) {
...
@@ -310,8 +318,9 @@ int32_t ESPHostLwIP::RSSI(uint8_t networkItem) {
}
}
void
ESPHostLwIP
::
lowPowerMode
()
{
void
ESPHostLwIP
::
lowPowerMode
()
{
if
(
!
initHW
())
if
(
!
initHW
())
{
return
;
return
;
}
ethernet_arch_lwip_begin
();
ethernet_arch_lwip_begin
();
CEspControl
::
getInstance
().
setPowerSaveMode
(
1
);
CEspControl
::
getInstance
().
setPowerSaveMode
(
1
);
ethernet_arch_lwip_end
();
ethernet_arch_lwip_end
();
...
...
libraries/lwIP_ESPHost/src/lwIP_ESPHost.h
View file @
972b7f53
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
You should have received a copy of the GNU Lesser General Public
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
#pragma once
#pragma once
...
...
tests/restyle.sh
View file @
972b7f53
...
@@ -14,7 +14,7 @@ for dir in ./cores/rp2040 ./libraries/EEPROM ./libraries/I2S ./libraries/SingleF
...
@@ -14,7 +14,7 @@ for dir in ./cores/rp2040 ./libraries/EEPROM ./libraries/I2S ./libraries/SingleF
./libraries/MouseBT ./libraries/SerialBT ./libraries/HID_Bluetooth
\
./libraries/MouseBT ./libraries/SerialBT ./libraries/HID_Bluetooth
\
./libraries/JoystickBLE ./libraries/KeyboardBLE ./libraries/MouseBLE
\
./libraries/JoystickBLE ./libraries/KeyboardBLE ./libraries/MouseBLE
\
./libraries/lwIP_w5500 ./libraries/lwIP_w5100 ./libraries/lwIP_enc28j60
\
./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
"*.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
\{\}
\;
find
$dir
-type
f
-name
"*.ino"
-exec
astyle
--suffix
=
none
--options
=
./tests/astyle_examples.conf
\{\}
\;
done
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