diff options
author | px4dev <px4@purgatory.org> | 2012-10-29 23:07:15 -0700 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2012-10-29 23:07:15 -0700 |
commit | 66da4395b4b0c6843e20ab09e105756338803540 (patch) | |
tree | 7426c86d853dbff788fb4da4870c9f544639125b /apps/systemlib | |
parent | 0616d5834039cc08057b862f80f8129a7b4948af (diff) | |
download | px4-firmware-66da4395b4b0c6843e20ab09e105756338803540.tar.gz px4-firmware-66da4395b4b0c6843e20ab09e105756338803540.tar.bz2 px4-firmware-66da4395b4b0c6843e20ab09e105756338803540.zip |
Kill the old board info code.
Diffstat (limited to 'apps/systemlib')
-rw-r--r-- | apps/systemlib/systemlib.c | 73 | ||||
-rw-r--r-- | apps/systemlib/systemlib.h | 5 |
2 files changed, 0 insertions, 78 deletions
diff --git a/apps/systemlib/systemlib.c b/apps/systemlib/systemlib.c index 750e783f5..b596b0f0e 100644 --- a/apps/systemlib/systemlib.c +++ b/apps/systemlib/systemlib.c @@ -110,76 +110,3 @@ int task_spawn(const char *name, int scheduler, int priority, int stack_size, ma return pid; } - -#define PX4_BOARD_ID_FMU (5) - -int fmu_get_board_info(struct fmu_board_info_s *info) -{ - /* Check which FMU version we're on */ - struct stat sb; - int statres; - - /* Copy version-specific fields */ - statres = stat("/dev/bma180", &sb); - - if (statres == OK) { - /* BMA180 indicates a v1.5-v1.6 board */ - strcpy(info->board_name, "FMU v1.6"); - info->board_version = 16; - - } else { - statres = stat("/dev/accel", &sb); - - if (statres == OK) { - /* MPU-6000 indicates a v1.7+ board */ - strcpy(info->board_name, "FMU v1.7"); - info->board_version = 17; - - } else { - /* If no BMA and no MPU is present, it is a v1.3 board */ - strcpy(info->board_name, "FMU v1.3"); - info->board_version = 13; - } - } - - /* Copy general FMU fields */ - memcpy(info->header, "PX4", 3); - info->board_id = PX4_BOARD_ID_FMU; - - return sizeof(struct fmu_board_info_s); -} - -int carrier_store_board_info(const struct carrier_board_info_s *info) -{ - int ret; - int fd = open("/dev/eeprom", O_RDWR | O_NONBLOCK); - - if (fd < 0) fprintf(stderr, "[boardinfo carrier] ERROR opening carrier eeprom\n"); - - /* Enforce correct header */ - ret = write(fd, info, sizeof(struct carrier_board_info_s)); - //ret = write(fd, "PX4", 3); - close(fd); - - return ret; -} - -int carrier_get_board_info(struct carrier_board_info_s *info) -{ - int ret; - int fd = open("/dev/eeprom", O_RDONLY | O_NONBLOCK); - - if (fd < 0) - return -1; /* no board */ - - ret = read(fd, info, sizeof(struct carrier_board_info_s)); - - /* Enforce NUL termination of human-readable string */ - if (ret == sizeof(struct carrier_board_info_s)) { - info->board_name[sizeof(info->board_name) - 1] = '\0'; - } - - close(fd); - - return ret; -} diff --git a/apps/systemlib/systemlib.h b/apps/systemlib/systemlib.h index f31c5cd1f..2c53c648b 100644 --- a/apps/systemlib/systemlib.h +++ b/apps/systemlib/systemlib.h @@ -117,11 +117,6 @@ struct __multiport_info { }; __EXPORT extern const struct __multiport_info multiport_info; -__EXPORT int carrier_store_board_info(const struct carrier_board_info_s *info); -__EXPORT int carrier_get_board_info(struct carrier_board_info_s *info); - -__EXPORT int fmu_get_board_info(struct fmu_board_info_s *info); - __END_DECLS #endif /* SYSTEMLIB_H_ */ |