mirror of
https://github.com/sipeed/MaixCDK.git
synced 2026-09-11 06:09:42 -05:00
41 lines
783 B
C++
41 lines
783 B
C++
#include "maix_util.hpp"
|
|
#include "maix_app.hpp"
|
|
#include "signal.h"
|
|
#include "maix_sys.hpp"
|
|
|
|
namespace maix::sys
|
|
{
|
|
static void signal_handle(int signal)
|
|
{
|
|
switch (signal) {
|
|
case SIGINT:
|
|
maix::app::set_exit_flag(true);
|
|
#if CONFIG_BUILD_WITH_MAIXPY
|
|
raise(SIGINT);
|
|
#endif
|
|
break;
|
|
default: break;
|
|
}
|
|
}
|
|
|
|
void poweroff()
|
|
{
|
|
log::info("Your platform is linux, poweroff will not execute");
|
|
}
|
|
|
|
void register_default_signal_handle() {
|
|
signal(SIGINT, signal_handle);
|
|
}
|
|
|
|
bool is_support(sys::Feature feature)
|
|
{
|
|
switch(feature)
|
|
{
|
|
case Feature::AI_ISP:
|
|
return false;
|
|
default:
|
|
return true;
|
|
}
|
|
}
|
|
}
|