int pwm_default_period; /**< The default PWM period is US */
int pwm_max_period; /**< Maximum period in us */
int pwm_min_period; /**< Minimum period in us */
- unsigned int platform_name_length; /**< Platform Name length */
- char* platform_name; /**< Platform Name pointer */
+ const char* platform_name; /**< Platform Name pointer */
mraa_pininfo_t* pins; /**< Pointer to pin array */
/*@}*/
} mraa_board_t;
{
if (plat == NULL)
return "Unknown";
- return plat->platform_name;
+ return (char*) plat->platform_name;
}
unsigned int
return NULL;
}
- b->platform_name_length = strlen(PLATFORM_NAME) + 1;
- b->platform_name = (char*) malloc(sizeof(char) * b->platform_name_length);
- if (b->platform_name == NULL) {
- goto error;
- }
- strncpy(b->platform_name, PLATFORM_NAME, b->platform_name_length);
-
+ b->platform_name = PLATFORM_NAME;
b->phy_pin_count = 18;
//b->gpio_count = 14;
b->aio_count = 0;
return NULL;
}
- b->platform_name_length = strlen(PLATFORM_NAME) + 1;
- b->platform_name = (char*) malloc(sizeof(char) * b->platform_name_length);
- if (b->platform_name == NULL) {
- goto error;
- }
- strncpy(b->platform_name, PLATFORM_NAME, b->platform_name_length);
-
+ b->platform_name = PLATFORM_NAME;
// This seciton will also check if the arduino board is there
tristate = mraa_gpio_init_raw(214);
if (tristate == NULL) {
return NULL;
}
- b->platform_name_length = strlen(PLATFORM_NAME) + 1;
- b->platform_name = (char*) malloc(sizeof(char) * b->platform_name_length);
- if (b->platform_name == NULL) {
- goto error;
- }
- strncpy(b->platform_name, PLATFORM_NAME, b->platform_name_length);
-
+ b->platform_name = PLATFORM_NAME;
b->phy_pin_count = 20;
b->gpio_count = 14;
b->aio_count = 6;
return NULL;
}
- b->platform_name_length = strlen(PLATFORM_NAME) + 1;
- b->platform_name = (char*) malloc(sizeof(char) * b->platform_name_length);
- if (b->platform_name == NULL) {
- goto error;
- }
- strncpy(b->platform_name, PLATFORM_NAME, b->platform_name_length);
-
+ b->platform_name = PLATFORM_NAME;
b->phy_pin_count = 20;
b->gpio_count = 14;
b->aio_count = 6;
return NULL;
}
- b->platform_name_length = strlen(PLATFORM_NAME) + 1;
- b->platform_name = (char*) malloc(sizeof(char) * b->platform_name_length);
- if (b->platform_name == NULL) {
- goto error;
- }
- strncpy(b->platform_name, PLATFORM_NAME, b->platform_name_length);
-
+ b->platform_name = PLATFORM_NAME;
b->phy_pin_count = MRAA_INTEL_MINNOW_MAX_PINCOUNT;
b->gpio_count = MRAA_INTEL_MINNOW_MAX_PINCOUNT;
b->aio_count = 0;