mirror of
https://git.aixiao.me/aixiao/Danger-alarm.git
synced 2025-07-29 19:13:39 +08:00
修复编译错误
This commit is contained in:
@@ -17,7 +17,7 @@ pico_generate_pio_header(Danger-alarm ${CMAKE_CURRENT_LIST_DIR}/Source/uart_tx.p
|
||||
pico_generate_pio_header(Danger-alarm ${CMAKE_CURRENT_LIST_DIR}/Source/uart_rx.pio)
|
||||
|
||||
target_sources(Danger-alarm PRIVATE
|
||||
lib/radio-switch.cc
|
||||
Lib/radio-switch.cc
|
||||
${CMAKE_CURRENT_LIST_DIR}/Source/common.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/Source/MAIN.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/Source/DTH11.cpp
|
||||
|
@@ -150,7 +150,9 @@ static uint16_t MH_Z14B(int *MH_Z14B_DATA_IS_OK)
|
||||
//printf("CHECKSUM: %X = %X\n", CO2_DATA[8], CHECKSUM);
|
||||
//printf("CO2 Concentration: %d ppm\n", CO2_CONC);
|
||||
*MH_Z14B_DATA_IS_OK = 1;
|
||||
} else {
|
||||
}
|
||||
/*
|
||||
else {
|
||||
// 校准传感器 零点 (ZERO)
|
||||
uint8_t ZERO[] = { 0XFF, 0X01, 0X87, 0X00, 0X00, 0X00, 0X00, 0X00, 0X78 };
|
||||
uart_write_blocking(UART1, ZERO, 9);
|
||||
@@ -164,6 +166,7 @@ static uint16_t MH_Z14B(int *MH_Z14B_DATA_IS_OK)
|
||||
*MH_Z14B_DATA_IS_OK = 0;
|
||||
printf("CO2 concentration reading failed!\n");
|
||||
}
|
||||
*/
|
||||
|
||||
return CO2_CONC;
|
||||
}
|
||||
@@ -251,7 +254,7 @@ static void core1_main()
|
||||
return;
|
||||
}
|
||||
|
||||
int main()
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
stdio_init_all();
|
||||
sleep_ms(1000);
|
||||
@@ -370,7 +373,7 @@ int main()
|
||||
printf("\r\n");
|
||||
|
||||
watchdog_update(); // 喂狗
|
||||
sleep_ms(3000);
|
||||
sleep_ms(5000);
|
||||
watchdog_update(); // 喂狗
|
||||
}
|
||||
|
||||
|
@@ -4,8 +4,8 @@
|
||||
#include <cstdio>
|
||||
#include "pico/stdlib.h"
|
||||
#include "hardware/gpio.h"
|
||||
#include "lib/pico-onewire/api/one_wire.h"
|
||||
#include "lib/radio-switch.h"
|
||||
#include "Lib/pico-onewire/api/one_wire.h"
|
||||
#include "Lib/radio-switch.h"
|
||||
|
||||
#include "hardware/clocks.h"
|
||||
#include "hardware/watchdog.h"
|
||||
|
Reference in New Issue
Block a user