Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

Commit

Permalink
[H3 port/pin names support] fixed runtime errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MX-Master committed Feb 18, 2018
1 parent d55f298 commit cc0f4ba
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/hal/drivers/hal_gpio_h3.c
Expand Up @@ -367,7 +367,7 @@ int32_t rtapi_app_main(void)
if ( token[1] == _GPIO_port_info[p].name )
{
// trying to find a correct pin number
pin = (uint8_t) strtol(token[2], NULL, 10);
pin = (uint8_t) strtol(&token[2], NULL, 10);

// if a correct pin number wasn't found
if ( pin >= _GPIO_port_info[p].pins_count )
Expand Down Expand Up @@ -396,6 +396,8 @@ int32_t rtapi_app_main(void)
{
PIN_EXPORT_FAILED_MSG_AND_RETURN;
}

break;
}
}

Expand Down Expand Up @@ -482,7 +484,7 @@ int32_t rtapi_app_main(void)
if ( token[1] == _GPIO_port_info[p].name )
{
// trying to find a correct pin number
pin = (uint8_t) strtol(token[2], NULL, 10);
pin = (uint8_t) strtol(&token[2], NULL, 10);

// if a correct pin number wasn't found
if ( pin >= _GPIO_port_info[p].pins_count )
Expand Down Expand Up @@ -529,6 +531,8 @@ int32_t rtapi_app_main(void)
hal_exit(comp_id);
return -1;
}

break;
}
}

Expand Down

0 comments on commit cc0f4ba

Please sign in to comment.