16 using namespace Linux;
21 #if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DISCO 32 #if HAL_UTILS_HEAT == HAL_LINUX_HEAT_PWM 36 HAL_LINUX_HEAT_PERIOD_NS);
38 #error Unrecognized Heat 79 }
else if (
state == 1) {
84 }
else if (
state == 3) {
96 #if CONFIG_HAL_BOARD_SUBTYPE != HAL_BOARD_SUBTYPE_LINUX_NONE 98 ts.tv_sec = time_utc_usec/1000000ULL;
99 ts.tv_nsec = (time_utc_usec % 1000000ULL) * 1000ULL;
100 clock_settime(CLOCK_REALTIME, &ts);
108 if (!path || lstat(path, &st) < 0) {
112 return S_ISCHR(st.st_mode);
130 int fd =
open(path, O_WRONLY | O_CLOEXEC);
138 int ret = vdprintf(fd, fmt, args);
139 int errno_bkp =
errno;
155 FILE *file =
fopen(path,
"re");
163 int ret = vfscanf(file, fmt, args);
164 int errno_bkp =
errno;
184 #define MAX_SIZE_LINE 50 188 FILE *
f =
fopen(
"/proc/cpuinfo",
"r");
194 if (strstr(buffer,
"Hardware") ==
nullptr) {
198 if (strstr(buffer,
_hw_names[i]) ==
nullptr) {
void _toneAlarm_timer_tick()
int open(const char *pathname, int flags)
POSIX Open a file with integer mode flags.
static const char * _hw_names[UTIL_NUM_HARDWARES]
void set_imu_temp(float current) override
int int read_file(const char *path, const char *fmt,...) FMT_SCANF(3
virtual void set_imu_temp(float current)
static ToneAlarm_Disco _toneAlarm
static const AP_HAL::HAL & hal
void set_tune(uint8_t tone)
int close(int fileno)
POSIX Close a file with fileno handel.
void init(int argc, char *const *argv)
void commandline_arguments(uint8_t &argc, char *const *&argv)
void toneAlarm_set_tune(uint8_t tune)
uint32_t available_memory(void) override
int stat(const char *name, struct stat *buf)
Display struct stat, from POSIX stat(0 or fstat(), in ASCII. NOT POSIX.
FILE * fopen(const char *path, const char *mode)
POSIX Open a file with path name and ascii file mode string.
int write_file(const char *path, const char *fmt,...) FMT_PRINTF(3
int errno
Note: fdevopen assigns stdin,stdout,stderr.
void set_imu_target_temp(int8_t *target) override
virtual void set_imu_target_temp(int8_t *target)
void set_system_clock(uint64_t time_utc_usec)
char * fgets(char *str, int size, FILE *stream)
get a string from stdin See fdevopen() sets stream->put get for TTY devices
bool is_chardev_node(const char *path)