Subversion Repositories Projects

Rev

Rev 404 | Rev 431 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 404 Rev 412
Line 353... Line 353...
353
    spi_send_byte(0x08, 0b10100000);
353
    spi_send_byte(0x08, 0b10100000);
Line 354... Line 354...
354
 
354
 
355
    // according to maxim writing to nvram takes about 12ms, lets wait longer
355
    // according to maxim writing to nvram takes about 12ms, lets wait longer
356
    _delay_ms(120);
356
    _delay_ms(120);
-
 
357
}
-
 
358
 
-
 
359
/**
-
 
360
 * wirte a <position> at <x>/<y> assuming it is a gps position for long-/latitude
-
 
361
 */
-
 
362
void write_gps_pos(uint8_t x, uint8_t y, int32_t position) {
-
 
363
        if (((uint32_t) position > 2147483647)) {
-
 
364
                position = position - 4294967295;
-
 
365
                write_char_xy(x++, y, 0x49); // minus
-
 
366
        } else {
-
 
367
                write_char_xy(x++, y, 0); // clear ('+' would be nice, maybe later)
-
 
368
        }
-
 
369
        write_ndigit_number_u(x, y, (uint16_t) (position / (int32_t) 10000000), 100, 1);
-
 
370
        write_char_xy(x + 3, y, 65); // decimal point
-
 
371
        position = position - ((position / (int32_t) 10000000) * (int32_t) 10000000);
-
 
372
        write_ndigit_number_u(x + 4, y, (uint16_t) (position / (int32_t) 1000), 1000, 1);
-
 
373
        position = position - ((uint16_t) (position / (int32_t) 1000) * (int32_t) 1000);
-
 
374
        write_ndigit_number_u(x + 8, y, (uint16_t) position, 100, 1);
-
 
375
        write_char_xy(x + 11, y, 0xD0); // degree symbol