@geastack/targets 0.1.99 → 0.1.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-config.json +10 -2
- package/package.json +7 -7
- package/targets/cmake/geatsc-generated-archive-build.mjs +32 -1
- package/targets/esp32/app_project.cmake +2 -2
- package/targets/esp32/chip_bindings/audio/echo_cancellation.cpp +392 -28
- package/targets/esp32/chip_bindings/audio/echo_cancellation.h +18 -2
- package/targets/esp32/chip_bindings/audio/es8311.cpp +117 -13
- package/targets/esp32/chip_bindings/displays/co5300.cpp +68 -28
- package/targets/esp32/components/gea_framework/CMakeLists.txt +17 -1
- package/targets/esp32/components/gea_framework/idf_component.yml +4 -0
- package/targets/esp32/components/gea_vpx/CMakeLists.txt +1 -1
- package/targets/esp32/connectivity/wifi.cpp +800 -543
- package/targets/esp32/display.cpp +121 -26
- package/targets/esp32/gea_framework.cmake +22 -28
- package/targets/esp32/host_sources.cmake +1 -0
- package/targets/esp32/services/comparison_benchmark.h +137 -0
- package/targets/esp32/services/comparison_gesture.h +133 -0
- package/targets/esp32/services/comparison_input_trace.h +64 -0
- package/targets/esp32/services/comparison_upload_capture.h +125 -0
- package/targets/esp32/services/debugger.h +634 -0
- package/targets/esp32/services/device_control.cpp +965 -20
- package/targets/esp32/services/frame_scheduler.cpp +128 -4
- package/targets/esp32/services/heap.cpp +125 -0
- package/targets/esp32/services/opus_benchmark.h +1 -1
- package/targets/esp32/services/storage_service.cpp +119 -104
- package/targets/esp32-p4-m5stack-tab5/dependencies.lock +27 -16
- package/targets/esp32-s3-m5stack-stopwatch/README.md +14 -9
- package/targets/esp32-s3-m5stack-stopwatch/dependencies.lock +54 -1
- package/targets/esp32-s3-m5stack-stopwatch/main/CMakeLists.txt +10 -7
- package/targets/esp32-s3-m5stack-stopwatch/main/buttons.cpp +80 -0
- package/targets/esp32-s3-m5stack-stopwatch/main/idf_component.yml +18 -0
- package/targets/esp32-s3-m5stack-stopwatch/main/include/board.h +38 -17
- package/targets/esp32-s3-m5stack-stopwatch/main/panel_reset.cpp +132 -129
- package/targets/esp32-s3-m5stack-stopwatch/main/power.cpp +253 -0
- package/targets/esp32-s3-m5stack-stopwatch/main/touch.cpp +158 -88
- package/targets/esp32-s3-m5stack-stopwatch/sdkconfig.defaults +13 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/CMakeLists.txt +30 -3
- package/targets/esp32-s3-touch-amoled-2.06/dependencies.lock +10 -148
- package/targets/esp32-s31-espressif-mosaico/README.md +34 -0
- package/targets/esp32-s31-espressif-mosaico/dependencies.lock +49 -1
- package/targets/esp32-s31-espressif-mosaico/main/CMakeLists.txt +23 -5
- package/targets/esp32-s31-espressif-mosaico/main/board_power.cpp +117 -0
- package/targets/esp32-s31-espressif-mosaico/main/camera.cpp +326 -0
- package/targets/esp32-s31-espressif-mosaico/main/idf_component.yml +11 -0
- package/targets/esp32-s31-espressif-mosaico/main/include/board.h +23 -0
- package/targets/esp32-s31-espressif-mosaico/main/nand_mount.cpp +172 -0
- package/targets/esp32-s31-espressif-mosaico/partitions.csv +7 -3
- package/targets/esp32-s31-espressif-mosaico/sdkconfig.defaults +24 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
#pragma once
|
|
3
|
+
|
|
4
|
+
#include "services/comparison_benchmark.h"
|
|
5
|
+
|
|
6
|
+
#if GEA_EMBEDDED_COMPARISON_BENCHMARK
|
|
7
|
+
#include <cstring>
|
|
8
|
+
|
|
9
|
+
namespace gea::platform::comparison::upload {
|
|
10
|
+
|
|
11
|
+
struct Snapshot {
|
|
12
|
+
std::uint16_t* pixels = nullptr;
|
|
13
|
+
int width = 0, height = 0;
|
|
14
|
+
std::uint64_t submittedPixels = 0;
|
|
15
|
+
unsigned covered = 0, errors = 0;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
inline std::mutex captureMutex;
|
|
19
|
+
inline std::atomic<bool> armed{false};
|
|
20
|
+
inline Snapshot state;
|
|
21
|
+
inline std::uint8_t* coverage = nullptr;
|
|
22
|
+
inline int x0 = 0, y0 = 0, x1 = -1, y1 = -1;
|
|
23
|
+
inline std::size_t cursor = 0;
|
|
24
|
+
|
|
25
|
+
inline bool begin(std::uint16_t* storage, int width, int height) {
|
|
26
|
+
const std::lock_guard<std::mutex> guard(captureMutex);
|
|
27
|
+
if (!storage || width <= 0 || height <= 0 || state.pixels ||
|
|
28
|
+
enabled.load(std::memory_order_acquire)) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
state = {storage, width, height, 0, 0, 0};
|
|
32
|
+
coverage = reinterpret_cast<std::uint8_t*>(storage + std::size_t(width) * height);
|
|
33
|
+
std::memset(coverage, 0, (std::size_t(width) * height + 7) / 8);
|
|
34
|
+
x0 = y0 = 0;
|
|
35
|
+
x1 = y1 = -1;
|
|
36
|
+
cursor = 0;
|
|
37
|
+
armed.store(true, std::memory_order_release);
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
inline void window(int left, int top, int right, int bottom) {
|
|
42
|
+
if (!armed.load(std::memory_order_acquire)) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const std::lock_guard<std::mutex> guard(captureMutex);
|
|
46
|
+
if (!armed.load(std::memory_order_relaxed)) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
x0 = left;
|
|
50
|
+
y0 = top;
|
|
51
|
+
x1 = right;
|
|
52
|
+
y1 = bottom;
|
|
53
|
+
cursor = 0;
|
|
54
|
+
if (left < 0 || top < 0 || right >= state.width || bottom >= state.height || right < left ||
|
|
55
|
+
bottom < top) {
|
|
56
|
+
++state.errors;
|
|
57
|
+
x0 = y0 = 0;
|
|
58
|
+
x1 = y1 = -1;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
inline void restart() {
|
|
63
|
+
if (!armed.load(std::memory_order_acquire)) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const std::lock_guard<std::mutex> guard(captureMutex);
|
|
67
|
+
cursor = 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Input bytes are exactly the submitted CO5300 big-endian RGB565 wire payload.
|
|
71
|
+
// Keep canonical RGB565 words for the existing little-endian RLE exporter.
|
|
72
|
+
inline void submitted(const void* buffer, std::size_t bytes) {
|
|
73
|
+
if (!armed.load(std::memory_order_acquire)) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const std::lock_guard<std::mutex> guard(captureMutex);
|
|
77
|
+
if (!armed.load(std::memory_order_relaxed)) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (!buffer || (bytes & 1) || x1 < x0 || y1 < y0) {
|
|
81
|
+
++state.errors;
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const std::size_t width = x1 - x0 + 1;
|
|
85
|
+
const std::size_t count = width * (y1 - y0 + 1);
|
|
86
|
+
if (bytes / 2 > count - std::min(cursor, count)) {
|
|
87
|
+
++state.errors;
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const auto* source = static_cast<const std::uint8_t*>(buffer);
|
|
91
|
+
for (std::size_t index = 0; index < bytes / 2; ++index, ++cursor) {
|
|
92
|
+
const std::size_t pixel = (y0 + cursor / width) * state.width + x0 + cursor % width;
|
|
93
|
+
state.pixels[pixel] = (std::uint16_t(source[index * 2]) << 8) | source[index * 2 + 1];
|
|
94
|
+
const auto mask = std::uint8_t(1u << (pixel & 7));
|
|
95
|
+
if (!(coverage[pixel / 8] & mask)) {
|
|
96
|
+
coverage[pixel / 8] |= mask;
|
|
97
|
+
++state.covered;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
state.submittedPixels += bytes / 2;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
inline void failed() {
|
|
104
|
+
if (!armed.load(std::memory_order_acquire)) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const std::lock_guard<std::mutex> guard(captureMutex);
|
|
108
|
+
if (armed.load(std::memory_order_relaxed)) {
|
|
109
|
+
++state.errors;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Caller first blocks app rendering and waits for DMA completion. Detaching
|
|
114
|
+
// under this lock stops future submissions touching the immutable export.
|
|
115
|
+
inline Snapshot end() {
|
|
116
|
+
const std::lock_guard<std::mutex> guard(captureMutex);
|
|
117
|
+
armed.store(false, std::memory_order_release);
|
|
118
|
+
const auto result = state;
|
|
119
|
+
state = {};
|
|
120
|
+
coverage = nullptr;
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
} // namespace gea::platform::comparison::upload
|
|
125
|
+
#endif
|