初始提交: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,112 @@
/*
Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "unity/examples/unity_config.h"
#include "unity/src/unity.h"
#include "common.h"
static cJSON item[1];
static void assert_is_value(cJSON *value_item, int type)
{
TEST_ASSERT_NOT_NULL_MESSAGE(value_item, "Item is NULL.");
assert_not_in_list(value_item);
assert_has_type(value_item, type);
assert_has_no_reference(value_item);
assert_has_no_const_string(value_item);
assert_has_no_string(value_item);
}
static void assert_parse_value(const char *string, int type)
{
parse_buffer buffer = { 0, 0, 0, 0, { 0, 0, 0 } };
buffer.content = (const unsigned char*) string;
buffer.length = strlen(string) + sizeof("");
buffer.hooks = global_hooks;
TEST_ASSERT_TRUE(parse_value(item, &buffer));
assert_is_value(item, type);
}
static void parse_value_should_parse_null(void)
{
assert_parse_value("null", cJSON_NULL);
reset(item);
}
static void parse_value_should_parse_true(void)
{
assert_parse_value("true", cJSON_True);
reset(item);
}
static void parse_value_should_parse_false(void)
{
assert_parse_value("false", cJSON_False);
reset(item);
}
static void parse_value_should_parse_number(void)
{
assert_parse_value("1.5", cJSON_Number);
reset(item);
}
static void parse_value_should_parse_string(void)
{
assert_parse_value("\"\"", cJSON_String);
reset(item);
assert_parse_value("\"hello\"", cJSON_String);
reset(item);
}
static void parse_value_should_parse_array(void)
{
assert_parse_value("[]", cJSON_Array);
reset(item);
}
static void parse_value_should_parse_object(void)
{
assert_parse_value("{}", cJSON_Object);
reset(item);
}
int CJSON_CDECL main(void)
{
/* initialize cJSON item */
memset(item, 0, sizeof(cJSON));
UNITY_BEGIN();
RUN_TEST(parse_value_should_parse_null);
RUN_TEST(parse_value_should_parse_true);
RUN_TEST(parse_value_should_parse_false);
RUN_TEST(parse_value_should_parse_number);
RUN_TEST(parse_value_should_parse_string);
RUN_TEST(parse_value_should_parse_array);
RUN_TEST(parse_value_should_parse_object);
return UNITY_END();
}