- Timestamp:
- 03/07/10 13:35:12 (15 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/webserver/httpd-cgi.c
r57 r58 250 250 strcat( uip_appdata, cCountBuf ); 251 251 252 for (i = 0; i < SOLAR_WATT_HISTORYSIZE; i++)252 for (i = SOLAR_WATT_HISTORYSIZE; i > 0; i--) 253 253 { 254 /* print history in reverse direction */ 254 255 sprintf( 255 256 cCountBuf, "SH %u %u %u %u\r\n", 256 ( SOLAR_WATT_HISTORY_STEPSIZE * i),257 SolarHistory[i ][0],258 SolarHistory[i ][1],259 SolarHistory[i ][2]257 ((SOLAR_WATT_HISTORY_STEPSIZE) * (i-1)), 258 SolarHistory[i-1][0], 259 SolarHistory[i-1][1], 260 SolarHistory[i-1][2] 260 261 ); 261 262 strcat( uip_appdata, cCountBuf ); webserver/example/EnergyMeters/Source/EnergyMeters/SolarCountUART.c
r57 r58 165 165 int i; 166 166 xLastSolarStateChangeTime = xTaskGetTickCount(); 167 xLastSolarHistoryAdvance = xTaskGetTickCount();168 167 xLastReadTime = xTaskGetTickCount(); 169 168 solarState = SOL_NO_INIT; … … 172 171 currentChannel = 0; 173 172 174 /* set datato invalid value */173 /* set recent data item to invalid value */ 175 174 chanWatt[0] = SOLAR_FSM_INVALID_VALUE; 176 175 chanWatt[1] = SOLAR_FSM_INVALID_VALUE; 177 176 chanWatt[2] = SOLAR_FSM_INVALID_VALUE; 178 177 179 /* invalidate history */ 180 for (i = 0; i < SOLAR_WATT_HISTORYSIZE; i++) 181 { 182 SolarHistory[i][0] = SOLAR_FSM_INVALID_VALUE; 183 SolarHistory[i][1] = SOLAR_FSM_INVALID_VALUE; 184 SolarHistory[i][2] = SOLAR_FSM_INVALID_VALUE; 185 } 178 /* do not invalidate history here so we do not lose all data */ 179 186 180 187 181 } /* initSolarFSM */ … … 711 705 static portTASK_FUNCTION( vSolar_Task, pvParameters ) 712 706 { 707 int i; 713 708 714 709 init_serial3(); 710 711 /* invalidate history */ 712 for (i = 0; i < SOLAR_WATT_HISTORYSIZE; i++) 713 { 714 SolarHistory[i][0] = SOLAR_FSM_INVALID_VALUE; 715 SolarHistory[i][1] = SOLAR_FSM_INVALID_VALUE; 716 SolarHistory[i][2] = SOLAR_FSM_INVALID_VALUE; 717 } 718 719 xLastSolarHistoryAdvance = xTaskGetTickCount(); 720 715 721 initSolarFSM(); 716 722