feat: complete v0.0.1 temperature and id reporting

This commit is contained in:
chenanchun 2026-01-30 20:02:48 +08:00
parent 62205e1377
commit 0539014bfd
2 changed files with 9 additions and 1 deletions

View File

@ -9,3 +9,5 @@ CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_PMC_COM=y
CONFIG_HWINFO=y
CONFIG_REBOOT=y

View File

@ -7,6 +7,7 @@
using namespace pmc;
auto sensor = DEVICE_DT_GET(DT_NODELABEL(godtek));
auto uart = DEVICE_DT_GET(DT_NODELABEL(usart2));
volatile bool flag{false};
@ -22,6 +23,11 @@ auto main(void) -> int {
};
while (1) {
for (int i = 0; i < 16; i++) {
uart_poll_out(uart, 0xAA);
}
k_msleep(100);
if (flag) {
sensor_value val{0, 0};
if (sensor_sample_fetch_chan(sensor, SENSOR_CHAN_AMBIENT_TEMP) == 0) {