初始提交:ESP-Scope 网页示波器固件(ESP32-S3)
Some checks failed
Release Firmware / build (boards/default.h, 9, 2, esp32, esp32) (push) Failing after 30m22s
Release Firmware / build (boards/xiao_esp32c6.h, 0, 8, xiao-esp32c6, esp32c6) (push) Failing after 1m35s
Release Firmware / release (push) Has been skipped

基于 vtalpaert/esp-scope 编译
- 采样率 1Hz-83kHz
- ADC1_CH0 (GPIO 1) 输入
- WiFi AP + Web UI
- 内置 PWM 测试信号 (GPIO 4)
- 单通道,0-3.3V 输入范围
This commit is contained in:
en
2026-07-02 23:42:08 +08:00
parent 41d6d68ff3
commit 1293fe9c44
170 changed files with 23275 additions and 21 deletions

View File

@@ -0,0 +1,77 @@
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#ifdef __cplusplus
extern "C" {
#endif
#include "../cJSON.h"
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); /* required by C89 */
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
cJSON *json;
size_t offset = 4;
unsigned char *copied;
char *printed_json = NULL;
int minify, require_termination, formatted, buffered;
if(size <= offset) return 0;
if(data[size-1] != '\0') return 0;
if(data[0] != '1' && data[0] != '0') return 0;
if(data[1] != '1' && data[1] != '0') return 0;
if(data[2] != '1' && data[2] != '0') return 0;
if(data[3] != '1' && data[3] != '0') return 0;
minify = data[0] == '1' ? 1 : 0;
require_termination = data[1] == '1' ? 1 : 0;
formatted = data[2] == '1' ? 1 : 0;
buffered = data[3] == '1' ? 1 : 0;
json = cJSON_ParseWithOpts((const char*)data + offset, NULL, require_termination);
if(json == NULL) return 0;
if(buffered)
{
printed_json = cJSON_PrintBuffered(json, 1, formatted);
}
else
{
/* unbuffered printing */
if(formatted)
{
printed_json = cJSON_Print(json);
}
else
{
printed_json = cJSON_PrintUnformatted(json);
}
}
if(printed_json != NULL) free(printed_json);
if(minify)
{
copied = (unsigned char*)malloc(size);
if(copied == NULL) return 0;
memcpy(copied, data, size);
cJSON_Minify((char*)copied + offset);
free(copied);
}
cJSON_Delete(json);
return 0;
}
#ifdef __cplusplus
}
#endif