3 #if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_NAVIO || \ 4 CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_NAVIO2 || \ 5 CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_EDGE || \ 6 CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_ERLEBRAIN2 || \ 7 CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BH || \ 8 CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DARK || \ 9 CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_PXFMINI 24 using namespace Linux;
37 FILE *
f =
fopen(
"/sys/firmware/devicetree/base/model",
"r");
38 if (f !=
nullptr &&
fgets(buffer, MAX_SIZE_LINE, f) !=
nullptr) {
61 printf(
"Raspberry Pi 2/3 with BCM2709!\n");
64 printf(
"Raspberry Pi 1 with BCM2708!\n");
68 fprintf(stderr,
"Could not detect RPi version, defaulting to 2/3\n");
int printf(const char *fmt,...)
static Util * from(AP_HAL::Util *util)
int sscanf(const char *buf, const char *fmt,...)
int get_rpi_version() const
FILE * fopen(const char *path, const char *mode)
POSIX Open a file with path name and ascii file mode string.
int fprintf(FILE *fp, const char *fmt,...)
fprintf character write function
const AP_HAL::HAL & hal
-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
char * fgets(char *str, int size, FILE *stream)
get a string from stdin See fdevopen() sets stream->put get for TTY devices