forked from EmbeddedTeam/app_photomagnetic
config(cmake): deleted unneedded files
This commit is contained in:
parent
d906bd7987
commit
c277f1d9ac
@ -3,11 +3,7 @@ cmake_minimum_required(VERSION 3.20.0)
|
|||||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||||
project(app_photomagnetic)
|
project(app_photomagnetic)
|
||||||
|
|
||||||
|
target_include_directories(app PRIVATE include)
|
||||||
target_sources(app PRIVATE src/main.cpp)
|
target_sources(app PRIVATE src/main.cpp)
|
||||||
|
|
||||||
set(ZEPHYR_EXTRA_MODULES "${CMAKE_SOURCE_DIR}/../../modules/godtek_temp")
|
|
||||||
set(ZEPHYR_EXTRA_MODULES "${CMAKE_SOURCE_DIR}/../../modules/photomagnetic_com")
|
|
||||||
|
|
||||||
target_include_directories(app PRIVATE
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../../modules/photomagnetic_com/include
|
|
||||||
)
|
|
||||||
26
include/watchdog.hpp
Normal file
26
include/watchdog.hpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#ifndef __ZPP_WATCHDOG_HPP
|
||||||
|
#define __ZPP_WATCHDOG_HPP
|
||||||
|
#include <zephyr/drivers/watchdog.h>
|
||||||
|
#include <zpp/assert.hpp>
|
||||||
|
namespace app {
|
||||||
|
class WatchDogConfig {
|
||||||
|
public:
|
||||||
|
WatchDogConfig() {
|
||||||
|
if (!device_is_ready(m_wtd)) {
|
||||||
|
__ASSERT_NO_MSG(0);
|
||||||
|
}
|
||||||
|
wdt_install_timeout(m_wtd, &wdt_timeout_cfg);
|
||||||
|
|
||||||
|
if (auto err = wdt_setup(m_wtd, WDT_OPT_PAUSE_HALTED_BY_DBG); err < 0) {
|
||||||
|
__ASSERT_NO_MSG(0);
|
||||||
|
}
|
||||||
|
wdt_timeout_cfg cfg;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
const device *m_wtd{DEVICE_DT_GET(DT_ALIAS(watchdog0))};
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace app
|
||||||
|
|
||||||
|
#endif
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include "watchdog.h"
|
||||||
#include "zpp/fmt.hpp"
|
#include "zpp/fmt.hpp"
|
||||||
#include <etl/vector.h>
|
#include <etl/vector.h>
|
||||||
#include <led_strip_indicator/led_strip_indicator.hpp>
|
#include <led_strip_indicator/led_strip_indicator.hpp>
|
||||||
@ -13,7 +14,6 @@ enum Command { kTemp = 0x00, kGetId, kRunningState };
|
|||||||
enum RunningState {};
|
enum RunningState {};
|
||||||
constexpr auto kDeviceIdSize = 20;
|
constexpr auto kDeviceIdSize = 20;
|
||||||
enum StatusId : uint8_t { kRunning, kPause, kError, kStandby };
|
enum StatusId : uint8_t { kRunning, kPause, kError, kStandby };
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
volatile bool flag{false};
|
volatile bool flag{false};
|
||||||
@ -21,7 +21,7 @@ auto main(void) -> int {
|
|||||||
pmc.SetRxCallback(kGetId, [](uart_com::DataType data) -> void {
|
pmc.SetRxCallback(kGetId, [](uart_com::DataType data) -> void {
|
||||||
uint8_t buffer[kDeviceIdSize];
|
uint8_t buffer[kDeviceIdSize];
|
||||||
auto size = hwinfo_get_device_id(buffer, sizeof(buffer));
|
auto size = hwinfo_get_device_id(buffer, sizeof(buffer));
|
||||||
pmc.Send("id", uart_com::DataType(buffer, size));
|
pmc.Send(kGetId, uart_com::DataType(buffer, size));
|
||||||
});
|
});
|
||||||
|
|
||||||
pmc.SetRxCallback(kRunningState, [](uart_com::DataType data) -> void {
|
pmc.SetRxCallback(kRunningState, [](uart_com::DataType data) -> void {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user