- Timestamp:
- 10/24/10 11:38:27 (14 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
webserver/example/EnergyMeters/Source/EnergyMeters/SolarCountUART.c
r74 r75 1403 1403 req_hour_yield[5] = 0x30 + channel; // channel 1404 1404 1405 1406 hourMSB = hour % 16; 1407 hourLSB = hour - hourMSB; 1405 if (hour >= 0x10) /* >= 16 */ 1406 { 1407 hourMSB = 1; 1408 } 1409 else 1410 { 1411 hourMSB = 0; 1412 } 1413 hourLSB = hour - (hourMSB * 0x10); 1414 1415 if (hourLSB <= 9) 1416 { 1417 req_hour_yield[9] = 0x30 + hourLSB; // minute LSB (binary coded hex) 1418 } 1419 else 1420 { 1421 req_hour_yield[9] = 0x40 + hourLSB - 0xA; // minute LSB (binary coded hex, 0xA --> 0x40, 0xF -> 0x45) 1422 } 1408 1423 1409 req_hour_yield[8] = 0x30 + hourMSB; // minute MSB (binary coded hex) 1410 req_hour_yield[9] = 0x30 + hourLSB; // minute LSB (binary coded hex) 1424 req_hour_yield[8] = 0x30 + hourMSB; // minute MSB (binary coded hex), 30 or 31 here. 1425 1411 1426 1412 1427 newChkSum = calculate_crc8( (&(req_hour_yield[0])), (sizeof(req_hour_yield)-1));