Dear all,

While trying to understand the TinyOS implementation of FTSP, in one of the
function, “calculateConversion()” from (TimeSyncP.nc), I have a small doubt
in the below part,

----------------------------------------------------------
while( ++i < MAX_ENTRIES )
   if( table[i].state == ENTRY_FULL )
   {          /*
                This only works because C ISO 1999 defines the signe for
modulo the same as for the Dividend!
             */
               localSum += (int32_t)(table[i].localTime - newLocalAverage)
/ tableEntries;
               localAverageRest += (table[i].localTime - newLocalAverage) %
tableEntries;
               offsetSum += (int32_t)(table[i].timeOffset -
newOffsetAverage) / tableEntries;
               offsetAverageRest += (table[i].timeOffset -
newOffsetAverage) % tableEntries;
 }
-----------------------------------
I think we need to add a typecast (int32_t) for the localAverageRest
calculation line also, That is, something like
localAverageRest += (int32_t) (table[i].localTime - newLocalAverage) %
tableEntries;

Kindly suggest..

Thanks for your valuable time

Regards
Jobish John
IIT Bombay
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to