355,3 → 355,22 |
// according to maxim writing to nvram takes about 12ms, lets wait longer |
_delay_ms(120); |
} |
|
/** |
* wirte a <position> at <x>/<y> assuming it is a gps position for long-/latitude |
*/ |
void write_gps_pos(uint8_t x, uint8_t y, int32_t position) { |
if (((uint32_t) position > 2147483647)) { |
position = position - 4294967295; |
write_char_xy(x++, y, 0x49); // minus |
} else { |
write_char_xy(x++, y, 0); // clear ('+' would be nice, maybe later) |
} |
write_ndigit_number_u(x, y, (uint16_t) (position / (int32_t) 10000000), 100, 1); |
write_char_xy(x + 3, y, 65); // decimal point |
position = position - ((position / (int32_t) 10000000) * (int32_t) 10000000); |
write_ndigit_number_u(x + 4, y, (uint16_t) (position / (int32_t) 1000), 1000, 1); |
position = position - ((uint16_t) (position / (int32_t) 1000) * (int32_t) 1000); |
write_ndigit_number_u(x + 8, y, (uint16_t) position, 100, 1); |
write_char_xy(x + 11, y, 0xD0); // degree symbol |
} |