api: introduce define for pin name size
MRAA_PIN_NAME_SIZE currently set at 12. Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
#define MRAA_PLATFORM_NAME_MAX_SIZE 64
|
#define MRAA_PLATFORM_NAME_MAX_SIZE 64
|
||||||
|
#define MRAA_PIN_NAME_SIZE 12
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ list_pins()
|
|||||||
for (i = 0; i < pin_count; ++i) {
|
for (i = 0; i < pin_count; ++i) {
|
||||||
if (strcmp(mraa_get_pin_name(i), "INVALID") != 0) {
|
if (strcmp(mraa_get_pin_name(i), "INVALID") != 0) {
|
||||||
fprintf(stdout, "%02d ", i);
|
fprintf(stdout, "%02d ", i);
|
||||||
fprintf(stdout, "%8s: ", mraa_get_pin_name(i));
|
fprintf(stdout, "%*s: ", (MRAA_PIN_NAME_SIZE - 1), mraa_get_pin_name(i));
|
||||||
if (mraa_pin_mode_test(i, MRAA_PIN_GPIO))
|
if (mraa_pin_mode_test(i, MRAA_PIN_GPIO))
|
||||||
fprintf(stdout, "GPIO ");
|
fprintf(stdout, "GPIO ");
|
||||||
if (mraa_pin_mode_test(i, MRAA_PIN_I2C))
|
if (mraa_pin_mode_test(i, MRAA_PIN_I2C))
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ typedef struct {
|
|||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/*@{*/
|
/*@{*/
|
||||||
char name[12]; /**< Pin's real world name */
|
char name[MRAA_PIN_NAME_SIZE]; /**< Pin's real world name */
|
||||||
mraa_pincapabilities_t capabilites; /**< Pin Capabiliites */
|
mraa_pincapabilities_t capabilites; /**< Pin Capabiliites */
|
||||||
mraa_pin_t gpio; /**< GPIO structure */
|
mraa_pin_t gpio; /**< GPIO structure */
|
||||||
mraa_pin_t pwm; /**< PWM structure */
|
mraa_pin_t pwm; /**< PWM structure */
|
||||||
|
|||||||
Reference in New Issue
Block a user