feat(product-test): add UART automation flow
This commit is contained in:
@@ -22,6 +22,11 @@ parsed_status_t s_status = {
|
||||
.has_paper = true,
|
||||
.paper_gpio_level = -1,
|
||||
.paper_present_level = 0,
|
||||
.battery_adc_ready = false,
|
||||
.ntc_adc_ready = false,
|
||||
.battery_adc_raw = -1,
|
||||
.ntc_adc_raw = -1,
|
||||
.battery_mv = 0,
|
||||
.battery = 100,
|
||||
.temperature = 25.0f,
|
||||
.updated_ms = 0,
|
||||
@@ -96,6 +101,11 @@ static void refresh_printer_status_locked(void) {
|
||||
s_status.has_paper = sensors.has_paper;
|
||||
s_status.paper_gpio_level = sensors.paper_gpio_level;
|
||||
s_status.paper_present_level = sensors.paper_present_level;
|
||||
s_status.battery_adc_ready = sensors.battery_adc_ready;
|
||||
s_status.ntc_adc_ready = sensors.ntc_adc_ready;
|
||||
s_status.battery_adc_raw = sensors.battery_adc_raw;
|
||||
s_status.ntc_adc_raw = sensors.ntc_adc_raw;
|
||||
s_status.battery_mv = sensors.battery_mv;
|
||||
s_status.battery = sensors.battery_percent;
|
||||
s_status.temperature = sensors.temperature_c;
|
||||
s_status.updated_ms = sensors.updated_ms;
|
||||
@@ -133,6 +143,11 @@ static void reset_runtime_state_locked(void) {
|
||||
s_status.has_paper = true;
|
||||
s_status.paper_gpio_level = -1;
|
||||
s_status.paper_present_level = 0;
|
||||
s_status.battery_adc_ready = false;
|
||||
s_status.ntc_adc_ready = false;
|
||||
s_status.battery_adc_raw = -1;
|
||||
s_status.ntc_adc_raw = -1;
|
||||
s_status.battery_mv = 0;
|
||||
s_status.battery = 100;
|
||||
s_status.temperature = 25.0f;
|
||||
s_status.updated_ms = 0;
|
||||
@@ -453,6 +468,11 @@ void printer_protocol_get_runtime_status(printer_runtime_status_t *out_status) {
|
||||
s_status.has_paper = sensors.has_paper;
|
||||
s_status.paper_gpio_level = sensors.paper_gpio_level;
|
||||
s_status.paper_present_level = sensors.paper_present_level;
|
||||
s_status.battery_adc_ready = sensors.battery_adc_ready;
|
||||
s_status.ntc_adc_ready = sensors.ntc_adc_ready;
|
||||
s_status.battery_adc_raw = sensors.battery_adc_raw;
|
||||
s_status.ntc_adc_raw = sensors.ntc_adc_raw;
|
||||
s_status.battery_mv = sensors.battery_mv;
|
||||
s_status.battery = sensors.battery_percent;
|
||||
s_status.temperature = sensors.temperature_c;
|
||||
s_status.updated_ms = sensors.updated_ms;
|
||||
@@ -464,6 +484,11 @@ void printer_protocol_get_runtime_status(printer_runtime_status_t *out_status) {
|
||||
out_status->has_paper = s_status.has_paper;
|
||||
out_status->paper_gpio_level = s_status.paper_gpio_level;
|
||||
out_status->paper_present_level = s_status.paper_present_level;
|
||||
out_status->battery_adc_ready = s_status.battery_adc_ready;
|
||||
out_status->ntc_adc_ready = s_status.ntc_adc_ready;
|
||||
out_status->battery_adc_raw = s_status.battery_adc_raw;
|
||||
out_status->ntc_adc_raw = s_status.ntc_adc_raw;
|
||||
out_status->battery_mv = s_status.battery_mv;
|
||||
out_status->battery_percent = s_status.battery;
|
||||
out_status->temperature = s_status.temperature;
|
||||
out_status->last_status_ms = s_status.updated_ms;
|
||||
|
||||
@@ -48,6 +48,9 @@ static uint16_t density_to_hot_time(const char *density) {
|
||||
if (density == NULL) {
|
||||
return 2000;
|
||||
}
|
||||
if (strcmp(density, "test") == 0) {
|
||||
return 200;
|
||||
}
|
||||
if (strcmp(density, "较淡") == 0) {
|
||||
return 1000;
|
||||
}
|
||||
|
||||
1283
components/domain/src/product_test_service.c
Normal file
1283
components/domain/src/product_test_service.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user