Fix bug when the number of PDO subindexes is 255

The problem was that for (sic = 1; sic <= si; sic++) never terminates if
si = 255 (number of subindexes) since sic was a uint8_t.
pull/11/head
Mikael Heden 2016-07-13 14:08:48 +02:00
parent 10c7f5191f
commit a53868daec
1 changed files with 2 additions and 4 deletions

View File

@ -70,8 +70,7 @@ int32_t SDO_findobject (uint16_t index)
*/
uint16_t sizeTXPDO (void)
{
uint8_t c, l, si, sic;
uint16_t size = 0, hobj;
uint16_t size = 0, hobj, l, si, c, sic;
int16_t nidx;
const _objd *objd;
@ -118,8 +117,7 @@ uint16_t sizeTXPDO (void)
*/
uint16_t sizeRXPDO (void)
{
uint8_t c, l, si, sic;
uint16_t size = 0, hobj;
uint16_t size = 0, hobj, c, l, si, sic;
int16_t nidx;
const _objd *objd;