Changeset 57 for webserver/example
- Timestamp:
- 03/07/10 11:21:08 (15 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/webserver/httpd-cgi.c
r56 r57 243 243 //strcat( ( char * ) uip_appdata, ( char * ) "\r\n" ); 244 244 245 246 247 sprintf( cCountBuf, "HIST %u %u\r\n", 248 SOLAR_WATT_HISTORY_STEPSIZE, 249 SOLAR_WATT_HISTORYSIZE ); 250 strcat( uip_appdata, cCountBuf ); 251 252 for (i = 0; i < SOLAR_WATT_HISTORYSIZE; i++) 253 { 254 sprintf( 255 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] 260 ); 261 strcat( uip_appdata, cCountBuf ); 262 } /* for */ 263 264 265 266 245 267 sprintf( cCountBuf, "<p><br>\r\nTSTmeter %u %u %u %u %u %u %u %u\r\n", 246 268 meterItems[METER_INDEX_TST].meterEnabled, … … 325 347 strcat( uip_appdata, cCountBuf ); 326 348 327 328 sprintf( cCountBuf, "HIST %u %u\r\n",329 SOLAR_WATT_HISTORY_STEPSIZE,330 SOLAR_WATT_HISTORYSIZE );331 strcat( uip_appdata, cCountBuf );332 333 for (i = 0; i < SOLAR_WATT_HISTORYSIZE; i++)334 {335 sprintf(336 cCountBuf, "SH %u %u %u %u\r\n",337 SOLAR_WATT_HISTORYSIZE,338 339 SolarHistory[i][0],340 SolarHistory[i][1],341 SolarHistory[i][2]342 );343 strcat( uip_appdata, cCountBuf );344 } /* for */345 349 346 350 //strcat( ( char * ) uip_appdata, ( char * ) "1234test" ); 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 */