Revision 410
works for real this time! I haven't tried actually running a current through the board, but without that it shows proper debug values and Robot Debug/main.c formats them nicely!
ConstantCharging.c | ||
---|---|---|
427 | 427 |
tempData[0] = 'C'; |
428 | 428 |
tempData[1] = abs_time>>8; |
429 | 429 |
tempData[2] = abs_time&0xFF; |
430 |
delay_ms(50); |
|
430 | 431 |
i2c_putpacket(0x01, tempData, 3); |
432 |
delay_ms(50); |
|
431 | 433 |
#endif |
432 | 434 |
|
433 | 435 |
mod=abs_time%4; |
... | ... | |
485 | 487 |
tempData[0] = 'P'; |
486 | 488 |
tempData[1] = 0; |
487 | 489 |
tempData[2] = OCR1B; |
490 |
delay_ms(50); |
|
488 | 491 |
i2c_putpacket(0x01, tempData, 3); |
492 |
delay_ms(50); |
|
489 | 493 |
tempData[0] = 'I'; |
490 | 494 |
tempData[1] = curr>>8; |
491 | 495 |
tempData[2] = curr&0xFF; |
496 |
delay_ms(50); |
|
492 | 497 |
i2c_putpacket(0x01, tempData, 3); |
498 |
delay_ms(50); |
|
493 | 499 |
#endif |
494 | 500 |
curr=6666; |
495 | 501 |
|
496 | 502 |
/* Absolute Voltage Termination */ |
497 |
if(supply_voltage()) |
|
498 |
{ |
|
499 | 503 |
mod=abs_time%4; |
500 | 504 |
while(abs_time%4==mod) |
501 | 505 |
{ |
... | ... | |
512 | 516 |
tempData[0] = 'V'; |
513 | 517 |
tempData[1] = volt>>8; |
514 | 518 |
tempData[2] = volt&0xFF; |
519 |
delay_ms(50); |
|
515 | 520 |
i2c_putpacket(0x01, tempData, 3); |
521 |
delay_ms(50); |
|
516 | 522 |
#endif |
517 | 523 |
volt=6666; |
518 | 524 |
|
... | ... | |
533 | 539 |
tempData[0] = 'T'; |
534 | 540 |
tempData[1] = temp>>8; |
535 | 541 |
tempData[2] = temp&0xFF; |
542 |
delay_ms(50); |
|
536 | 543 |
i2c_putpacket(0x01, tempData, 3); |
544 |
delay_ms(50); |
|
537 | 545 |
#endif |
538 |
} |
|
539 | 546 |
|
540 | 547 |
temp=6666; |
541 | 548 |
} |
Also available in: Unified diff