Skip to content

Commit 17fc905

Browse files
committed
Add RP2040 (Pi Pico W) support
1 parent 4c1494e commit 17fc905

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

EmbAJAX.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -699,8 +699,15 @@ template<size_t NUM> class EmbAJAXPage : public EmbAJAXContainer<NUM>, public Em
699699
#include <EmbAJAXOutputDriverESP8266.h>
700700
#elif defined (ESP32)
701701
#include <EmbAJAXOutputDriverESP32.h>
702+
#elif defined (ARDUINO_ARCH_RP2040)
703+
#include <EmbAJAXOutputDriverRP2040.h>
702704
#else
703-
#error No output driver available for this hardware (yet). Please implement your own (it is easy!) and submit a patch.
705+
#include <WebServer.h>
706+
#define EmbAJAXOutputDriverWebServerClass WebServer
707+
#include <WiFi.h>
708+
#include <EmbAJAXOutputDriverGeneric.h>
709+
#warning No output driver available for this hardware (yet). We try using the generic driver, but success is not guaranteed.
710+
#warning In most cases, implementing a driver is as easy as picking the correct header file to include. Please consider submitting a patch.
704711
#endif
705712
#endif
706713

EmbAJAXOutputDriverRP2040.h

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
*
3+
* EmbAJAX - Simplistic framework for creating and handling displays and controls on a WebPage served by an Arduino (or other small device).
4+
*
5+
* Copyright (C) 2018-2019 Thomas Friedrichsmeier
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU Lesser General Public License as published
9+
* by the Free Software Foundation, either version 3 of the License, or (at
10+
* your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*
20+
**/
21+
22+
#ifndef EMBAJAXOUTPUTDRIVERRP2040_H
23+
#define EMBAJAXOUTPUTDRIVERRP2040_H
24+
25+
#include <WebServer.h>
26+
#define EmbAJAXOutputDriverWebServerClass WebServer
27+
#include <WiFi.h> // Makes the examples work cross-platform; not strictly needed
28+
29+
// the actual implementation
30+
#include "EmbAJAXOutputDriverGeneric.h"
31+
32+
#endif

0 commit comments

Comments
 (0)