Subversion Repositories Projects

Rev

Rev 466 | Rev 468 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 466 Rev 467
Line 70... Line 70...
70
char stats_item_2[] PROGMEM = "max Distance:";
70
char stats_item_2[] PROGMEM = "max Distance:";
71
char stats_item_3[] PROGMEM = "min voltage :";
71
char stats_item_3[] PROGMEM = "min voltage :";
72
char stats_item_4[] PROGMEM = "max time    :";
72
char stats_item_4[] PROGMEM = "max time    :";
73
char stats_item_5[] PROGMEM = "longitude   :";
73
char stats_item_5[] PROGMEM = "longitude   :";
74
char stats_item_6[] PROGMEM = "latitude    :";
74
char stats_item_6[] PROGMEM = "latitude    :";
-
 
75
char stats_item_7[] PROGMEM = "max current :";
75
char* stats_item_pointers[] PROGMEM = {stats_item_0, stats_item_1, stats_item_2,
76
char* stats_item_pointers[] PROGMEM = {stats_item_0, stats_item_1, stats_item_2,
76
    stats_item_3, stats_item_4, stats_item_5, stats_item_6};
77
    stats_item_3, stats_item_4, stats_item_5, stats_item_6, stats_item_7};
Line 77... Line 78...
77
 
78
 
78
// store more fixed strings in progmen
79
// store more fixed strings in progmen
79
char ON[] PROGMEM = "ON ";
80
char ON[] PROGMEM = "ON ";
Line 149... Line 150...
149
 
150
 
150
volatile size_t icnt = 0;
151
volatile size_t icnt = 0;
151
volatile unsigned char * iptr;
152
volatile unsigned char * iptr;
152
volatile unsigned char spi_cmd_buffer[5];
153
volatile unsigned char spi_cmd_buffer[5];
153
volatile uint8_t spi_ready = 1;
154
volatile uint8_t spi_ready = 1;
Line 154... Line 155...
154
int16_t ampere = 0;
155
int16_t ampere = 0, max_ampere = 0;
155
 
156
 
156
/**
157
/**
157
 * SPI interrupt handler
158
 * SPI interrupt handler
Line 551... Line 552...
551
        if (!icnt && spi_ready) {
552
        if (!icnt && spi_ready) {
552
            // correct transfer ends with d (done)
553
            // correct transfer ends with d (done)
553
            if (spi_cmd_buffer[0] == 'd') {
554
            if (spi_cmd_buffer[0] == 'd') {
554
                ampere = spi_cmd_buffer[1] << 8;
555
                ampere = spi_cmd_buffer[1] << 8;
555
                ampere |= spi_cmd_buffer[2];
556
                ampere |= spi_cmd_buffer[2];
-
 
557
                                // if this is the first receival we should print the small A
-
 
558
                                if (!(COSD_FLAGS2 & COSD_FLAG_STROMREC)) {
-
 
559
                                        COSD_FLAGS &= ~COSD_ICONS_WRITTEN;
556
                // update flags
560
                                        // update this flag
557
                COSD_FLAGS2 |= COSD_FLAG_STROMREC;
561
                        COSD_FLAGS2 |= COSD_FLAG_STROMREC;
-
 
562
                                }
558
                //write_ascii_char(8+4*30, 'v'); // valid
563
                //write_ascii_char(8+4*30, 'v'); // valid
559
            } else {
564
            } else {
560
                // update flags
565
                // update flags
561
                COSD_FLAGS2 &= ~COSD_FLAG_STROMREC;
566
                COSD_FLAGS2 &= ~COSD_FLAG_STROMREC;
562
                //write_ascii_char(8+4*30, 'i'); // invalid
567
                //write_ascii_char(8+4*30, 'i'); // invalid