Skip to content

Commit

Permalink
up.c: Fixed pin name size on up board
Browse files Browse the repository at this point in the history
Signed-off-by: Nicola Lunghi <[email protected]>
  • Loading branch information
Nicola Lunghi authored and arfoll committed May 12, 2017
1 parent 9d65d6e commit d1048d1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/x86/up.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@
#include "x86/up.h"

#define PLATFORM_NAME "UP"
#define MAX_LENGTH 8

static mraa_result_t
mraa_up_set_pininfo(mraa_board_t* board, int mraa_index, char* name, mraa_pincapabilities_t caps, int sysfs_pin)
{
if (mraa_index < board->phy_pin_count) {
mraa_pininfo_t* pin_info = &board->pins[mraa_index];
strncpy(pin_info->name, name, MAX_LENGTH);
strncpy(pin_info->name, name, MRAA_PIN_NAME_SIZE);
pin_info->capabilities = caps;
if (caps.gpio) {
pin_info->gpio.pinmap = sysfs_pin;
Expand Down Expand Up @@ -76,7 +75,7 @@ mraa_up_get_pin_index(mraa_board_t* board, char* name, int* pin_index)
{
int i;
for (i = 0; i < board->phy_pin_count; ++i) {
if (strncmp(name, board->pins[i].name, MAX_LENGTH) == 0) {
if (strncmp(name, board->pins[i].name, MRAA_PIN_NAME_SIZE) == 0) {
*pin_index = i;
return MRAA_SUCCESS;
}
Expand Down

0 comments on commit d1048d1

Please sign in to comment.