Skip to content

Commit faec223

Browse files
committed
fix(build): update platform config, fix build errors and frontend errors
1 parent 0ff02ce commit faec223

File tree

10 files changed

+719
-695
lines changed

10 files changed

+719
-695
lines changed

.github/workflows/build-and-release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Set up Python environment
2222
uses: actions/setup-python@v2
2323
with:
24-
python-version: '3.8'
24+
python-version: '3.9'
2525

2626
- name: Install PlatformIO
2727
run: |
@@ -82,7 +82,7 @@ jobs:
8282
- name: Set up Python environment
8383
uses: actions/setup-python@v2
8484
with:
85-
python-version: '3.8'
85+
python-version: '3.9'
8686

8787
- name: Install PlatformIO
8888
run: |

frontend/.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VITE_WS_URL=ws://192.168.1.143/
2-
VITE_BASE_URL=http://192.168.1.143/
1+
VITE_WS_URL=ws://192.168.178.50/
2+
VITE_BASE_URL=http://192.168.178.50/

frontend/src/components/layout/sidebar.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export const Sidebar: Component<SidebarProps> = (props) => {
5757
</select>
5858
<Tooltip text="Save current display mode as default startup mode">
5959
<button
60+
type="button"
6061
onClick={props.onPersistPlugin}
6162
class="w-full bg-blue-600 text-white border-0 px-4 py-3 uppercase text-sm leading-6 tracking-wider cursor-pointer font-bold hover:opacity-80 active:translate-y-[-1px] transition-all rounded"
6263
>
@@ -75,6 +76,7 @@ export const Sidebar: Component<SidebarProps> = (props) => {
7576
<div class="flex gap-2.5">
7677
<Tooltip text="Rotate display counter-clockwise">
7778
<button
79+
type="button"
7880
onClick={() => props.onRotate(false)}
7981
class="w-full bg-blue-600 text-white border-0 px-4 py-3 uppercase text-sm leading-6 tracking-wider cursor-pointer font-bold hover:opacity-80 active:translate-y-[-1px] transition-all rounded"
8082
>
@@ -83,6 +85,7 @@ export const Sidebar: Component<SidebarProps> = (props) => {
8385
</Tooltip>
8486
<Tooltip text="Rotate display clockwise">
8587
<button
88+
type="button"
8689
onClick={() => props.onRotate(true)}
8790
class="w-full bg-blue-600 text-white border-0 px-4 py-3 uppercase text-sm leading-6 tracking-wider cursor-pointer font-bold hover:opacity-80 active:translate-y-[-1px] transition-all rounded"
8891
>
@@ -105,7 +108,7 @@ export const Sidebar: Component<SidebarProps> = (props) => {
105108
onInput={(e) =>
106109
props.onBrightnessChange(parseInt(e.currentTarget.value))
107110
}
108-
onPointerUp={(e) =>
111+
onPointerUp={() =>
109112
props.onBrightnessChange(store.brightness, true)
110113
}
111114
/>
@@ -129,7 +132,7 @@ export const Sidebar: Component<SidebarProps> = (props) => {
129132
onInput={(e) =>
130133
props.onArtnetChange(parseInt(e.currentTarget.value))
131134
}
132-
onPointerUp={(e) =>
135+
onPointerUp={() =>
133136
props.onArtnetChange(store.artnetUniverse, true)
134137
}
135138
/>
@@ -140,14 +143,14 @@ export const Sidebar: Component<SidebarProps> = (props) => {
140143
</SidebarSection>
141144
</Show>
142145

143-
144146
<Show when={store?.plugin === 1 && !store?.isActiveScheduler}>
145147
<div class="my-6 border-t border-gray-200" />
146148

147149
<SidebarSection title="Matrix Controls">
148150
<div class="grid grid-cols-2 gap-2">
149151
<Tooltip text="Import image from your device">
150152
<button
153+
type="button"
151154
onClick={props.onLoadImage}
152155
class="w-full bg-blue-600 text-white border-0 px-4 py-3 uppercase text-sm leading-6 tracking-wider cursor-pointer font-bold hover:opacity-80 active:translate-y-[-1px] transition-all rounded"
153156
>
@@ -156,6 +159,7 @@ export const Sidebar: Component<SidebarProps> = (props) => {
156159
</Tooltip>
157160
<Tooltip text="Clear all pixels">
158161
<button
162+
type="button"
159163
onClick={props.onClear}
160164
class="w-full bg-blue-600 text-white border-0 px-4 py-3 uppercase text-sm leading-6 tracking-wider cursor-pointer font-bold hover:opacity-80 active:translate-y-[-1px] transition-all rounded hover:bg-red-600"
161165
>
@@ -164,6 +168,7 @@ export const Sidebar: Component<SidebarProps> = (props) => {
164168
</Tooltip>
165169
<Tooltip text="Save current display state">
166170
<button
171+
type="button"
167172
onClick={props.onPersist}
168173
class="w-full bg-blue-600 text-white border-0 px-4 py-3 uppercase text-sm leading-6 tracking-wider cursor-pointer font-bold hover:opacity-80 active:translate-y-[-1px] transition-all rounded"
169174
>
@@ -172,6 +177,7 @@ export const Sidebar: Component<SidebarProps> = (props) => {
172177
</Tooltip>
173178
<Tooltip text="Load last saved state">
174179
<button
180+
type="button"
175181
onClick={props.onLoad}
176182
class="w-full bg-blue-600 text-white border-0 px-4 py-3 uppercase text-sm leading-6 tracking-wider cursor-pointer font-bold hover:opacity-80 active:translate-y-[-1px] transition-all rounded"
177183
>

frontend/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export interface Store {
3434
leds: number[];
3535
plugins: { id: number; name: string }[];
3636
plugin: number;
37+
artnetUniverse: number;
3738
systemStatus: SYSTEM_STATUS;
3839
connectionState: () => number;
3940
connectionStatus?: string;

include/messages.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class MessagePool
5959
void release(Message *msg)
6060
{
6161
ptrdiff_t index = msg - pool;
62-
if (index >= 0 && index < POOL_SIZE)
62+
if (index >= 0 && index < static_cast<ptrdiff_t>(POOL_SIZE))
6363
{
6464
used[index] = false;
6565
pool[index].reset();

include/plugins/DDPPlugin.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
#pragma once
22

33
#include "PluginManager.h"
4+
#if __has_include("AsyncUDP.h")
45
#include "AsyncUDP.h"
6+
#define ASYNC_UDP_ENABLED
7+
#endif
58

69
class DDPPlugin : public Plugin
710
{
811
private:
12+
#ifdef ASYNC_UDP_ENABLED
913
AsyncUDP *udp;
14+
#endif
1015

1116
public:
1217
void setup() override;

platformio.ini

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ monitor_filters = esp32_exception_decoder
3030
; upload_port = 192.168.178.50
3131

3232
[env:ESP32-wemos]
33-
#platform = espressif32
34-
platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.20/platform-espressif32.zip
33+
platform = espressif32
3534
board = wemos_d1_mini32
3635
framework = arduino
3736
lib_deps =
@@ -49,8 +48,7 @@ monitor_filters = esp32_exception_decoder
4948
; upload_port = 192.168.178.50
5049

5150
[env:esp32dev]
52-
#platform = espressif32
53-
platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.20/platform-espressif32.zip
51+
platform = espressif32
5452
board = esp32dev
5553
framework = arduino
5654
lib_deps =
@@ -72,12 +70,14 @@ board = nodemcuv2
7270
platform = espressif8266
7371
framework = arduino
7472
monitor_filters = esp8266_exception_decoder
73+
build_flags = -fexceptions
74+
build_unflags = -fno-exceptions
7575
lib_deps =
7676
https://github.com/me-no-dev/ESPAsyncWebServer.git
7777
https://github.com/vshymanskyy/Preferences.git
78+
https://github.com/tzapu/WiFiManager.git#v2.0.17
7879
bblanchon/ArduinoJson@^6.21.5
7980
mickey9801/ButtonFever@^1.0
80-
8181
monitor_speed = 115200
8282
board_build.f_cpu = 80000000L
8383

@@ -86,6 +86,8 @@ board = d1_mini_pro
8686
platform = espressif8266
8787
framework = arduino
8888
monitor_filters = esp8266_exception_decoder
89+
build_flags = -fexceptions
90+
build_unflags = -fno-exceptions
8991
lib_deps =
9092
https://github.com/me-no-dev/ESPAsyncWebServer.git
9193
https://github.com/vshymanskyy/Preferences.git

src/main.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
#include <SPI.h>
33
#include <BfButton.h>
44

5-
#ifdef ESP82666
5+
#ifdef ESP8266
66
/* Fix duplicate defs of HTTP_GET, HTTP_POST, ... in ESPAsyncWebServer.h */
77
#define WEBSERVER_H
88
#endif
9+
10+
911
#include <WiFiManager.h>
1012

1113
#ifdef ESP32
@@ -225,14 +227,14 @@ void screenDrawingTask()
225227
void setup()
226228
{
227229
baseSetup();
228-
Scheduler.start(&screenDrawingTask);
230+
Scheduler.start();
229231
}
230232
#endif
231233

232234
void loop()
233235
{
234236
static uint8_t taskCounter = 0;
235-
const unsigned long currentMillis = millis();
237+
236238
btn.read();
237239

238240
#if !defined(ESP32) && !defined(ESP8266)

src/plugins/DDPPlugin.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
void DDPPlugin::setup()
44
{
5+
#ifdef ASYNC_UDP_ENABLED
56
udp = new AsyncUDP();
67
if (udp->listen(4048))
78
{
@@ -28,15 +29,18 @@ void DDPPlugin::setup()
2829
}
2930
});
3031
}
32+
#endif
3133
}
3234

3335
void DDPPlugin::teardown()
3436
{
37+
#ifdef ASYNC_UDP_ENABLED
3538
if (udp)
3639
{
3740
delete udp;
3841
udp = nullptr;
3942
}
43+
#endif
4044
}
4145

4246
void DDPPlugin::loop()

0 commit comments

Comments
 (0)