Show
Ignore:
Timestamp:
03/07/10 11:21:08 (15 years ago)
Author:
phil
Message:

completed solar history entries

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • webserver/example/EnergyMeters/Source/EnergyMeters/SolarCountUART.c

    r56 r57  
    381381  { 
    382382    advanceHistoryArray(); 
     383    xLastSolarHistoryAdvance = xTaskGetTickCount(); /* update timer */ 
    383384  } 
    384385  else if (xTaskGetTickCount() < xLastSolarHistoryAdvance) 
     
    561562 
    562563  /* advance entries by 1. we do not care about data locking here. */ 
    563   for (i = 0; i < (SOLAR_WATT_HISTORYSIZE-1); i++
     564  for (i = SOLAR_WATT_HISTORYSIZE-1; i > 0; i--
    564565  { 
    565566    portENTER_CRITICAL(); 
    566     SolarHistory[i+1][0] = SolarHistory[i][0]; 
    567     SolarHistory[i+1][1] = SolarHistory[i][1]; 
    568     SolarHistory[i+1][2] = SolarHistory[i][2]; 
     567    SolarHistory[i][0] = SolarHistory[i-1][0]; 
     568    SolarHistory[i][1] = SolarHistory[i-1][1]; 
     569    SolarHistory[i][2] = SolarHistory[i-1][2]; 
    569570    portEXIT_CRITICAL(); 
    570571  } /* for */