Changeset 57 for webserver/example/EnergyMeters/Source
- Timestamp:
- 03/07/10 11:21:08 (15 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
webserver/example/EnergyMeters/Source/EnergyMeters/SolarCountUART.c
r56 r57 381 381 { 382 382 advanceHistoryArray(); 383 xLastSolarHistoryAdvance = xTaskGetTickCount(); /* update timer */ 383 384 } 384 385 else if (xTaskGetTickCount() < xLastSolarHistoryAdvance) … … 561 562 562 563 /* 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--) 564 565 { 565 566 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]; 569 570 portEXIT_CRITICAL(); 570 571 } /* for */