Skip to content

Commit 61742c9

Browse files
Disable WiFi.begin on plain Pico, add JSON (#682)
1 parent fee0366 commit 61742c9

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

libraries/WiFi/src/WiFiClass.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ int WiFiClass::begin(const char* ssid) {
6868
return begin(ssid, nullptr);
6969
}
7070

71+
#ifdef ARDUINO_RASPBERRY_PI_PICO_W
7172
/* Start WiFi connection with passphrase
7273
the most secure supported mode will be automatically selected
7374
@@ -148,6 +149,7 @@ uint8_t WiFiClass::beginAP(const char *ssid, const char* passphrase) {
148149

149150
return WL_CONNECTED;
150151
}
152+
#endif
151153

152154
bool WiFiClass::connected() {
153155
return _wifi.connected() && localIP().isSet();

tools/build.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ def compile(tmp_dir, sketch, cache, tools_dir, hardware_dir, ide_path, f, args):
6565
'dbgport={dbgport},' \
6666
'dbglvl={dbglvl},' \
6767
'usbstack={usbstack}'.format(**vars(args))
68+
if "/WiFi" in sketch:
69+
fqbn = fqbn.replace("rpipico", "rpipicow")
6870
cmd += [fqbn]
6971
cmd += ['-built-in-libraries', ide_path + '/libraries']
7072
cmd += ['-ide-version=10607']

tools/json/rpipicow.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"earlephilhower": {
5+
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
6+
"usb_vid": "0x2e8a",
7+
"usb_pid": "0xf00a"
8+
}
9+
},
10+
"core": "earlephilhower",
11+
"cpu": "cortex-m0plus",
12+
"extra_flags": "-D ARDUINO_RASPBERRY_PI_PICO_W -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
13+
"f_cpu": "133000000L",
14+
"hwids": [
15+
[
16+
"0x2E8A",
17+
"0x00C0"
18+
]
19+
],
20+
"mcu": "rp2040",
21+
"variant": "rpipicow"
22+
},
23+
"debug": {
24+
"jlink_device": "RP2040_M0_0",
25+
"openocd_target": "rp2040.cfg",
26+
"svd_path": "rp2040.svd"
27+
},
28+
"frameworks": [
29+
"arduino"
30+
],
31+
"name": "Pico W",
32+
"upload": {
33+
"maximum_ram_size": 270336,
34+
"maximum_size": 2097152,
35+
"require_upload_port": true,
36+
"native_usb": true,
37+
"use_1200bps_touch": true,
38+
"wait_for_upload_port": false,
39+
"protocol": "picotool",
40+
"protocols": [
41+
"cmsis-dap",
42+
"jlink",
43+
"raspberrypi-swd",
44+
"picotool",
45+
"picoprobe"
46+
]
47+
},
48+
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
49+
"vendor": "Raspberry Pi"
50+
}

0 commit comments

Comments
 (0)