Files
mayhem-firmware/firmware/application
MsfPablo 9067e007b6 Fix GeoPos losing the sign of coordinates between 0 and -1 (#3283)
GeoPos stored a coordinate's sign only in its degrees NumberField, which
is an int32_t and therefore has no negative zero. Any coordinate whose
integer degrees part is 0 but which is negative (i.e. strictly between
0.0 and -1.0) could not be represented at all:

  - set_lat()/set_lon() passed the raw float to the degrees field, so
    -0.2933 truncated to 0 and the sign was gone before it reached the
    widget.
  - lat()/lon() then decided the sign with `field_lon_degrees.value() < 0`,
    which is false for 0, so the value came back positive.

The reporter's airport is at longitude -0.2933, which was impossible to
enter in the ADSB Tx app.

Give each coordinate an explicit hemisphere field (N/S and E/W) and make
the degrees field an unsigned magnitude:

  - The hemisphere OptionsField is the single source of the sign, so
    "negative with zero degrees" is now representable.
  - set_lat()/set_lon() derive the hemisphere from the sign of the input
    and feed the fields the magnitude.
  - lat()/lon() read the hemisphere instead of inferring the sign from
    the degrees value.
  - The minutes on_wrap handlers no longer need to flip the carry
    direction based on the degrees sign, since degrees is now a
    magnitude; the carry is the same in both hemispheres.
  - The degrees fields no longer loop, so carrying below 0 clamps at 0
    instead of wrapping round to 90/180.

The hemisphere indicator occupies the column that the 4-wide signed
degrees field used for its minus sign, so the row layout, the degree
symbol and the decimal readout all stay where they were.

Fixes #3234
2026-08-08 21:18:18 +02:00
..
2026-07-10 21:37:41 +02:00
2026-07-06 11:05:49 +08:00
2026-07-06 11:05:49 +08:00
2026-01-08 10:34:05 +01:00
2026-07-10 21:37:41 +02:00
2026-06-19 07:48:55 +02:00
2025-12-14 11:26:21 +01:00
2026-06-15 19:28:47 +02:00
2026-06-15 19:28:47 +02:00
2026-02-24 11:23:41 +01:00
2026-05-09 12:23:43 +02:00
2025-12-14 11:26:21 +01:00
2024-11-22 09:54:34 +01:00
2026-05-10 00:08:05 +02:00
2025-04-11 10:46:04 +00:00
2026-06-12 22:15:44 +02:00
2024-11-08 11:46:27 +01:00
2024-11-08 11:46:27 +01:00
2026-02-24 11:23:41 +01:00
2026-01-30 17:18:13 +01:00
2026-02-12 12:41:12 +01:00
2026-01-16 09:57:45 +01:00
2026-01-16 09:57:45 +01:00
2026-06-19 07:48:55 +02:00
2024-11-19 17:16:37 +01:00
2024-11-19 17:16:37 +01:00
2026-07-10 21:37:41 +02:00
2026-02-24 11:23:41 +01:00
2026-07-02 10:05:34 +02:00
2026-07-02 10:05:34 +02:00
2025-11-26 19:13:21 +01:00
2026-04-30 15:00:19 +02:00
2026-02-24 11:23:41 +01:00
2025-09-01 11:50:46 +02:00
2026-02-24 11:23:41 +01:00
2024-11-22 09:54:34 +01:00
2024-11-22 09:54:34 +01:00
2026-06-19 07:48:55 +02:00
2026-04-30 15:00:19 +02:00
2026-04-30 15:00:19 +02:00
2026-04-30 15:00:19 +02:00
2026-02-24 11:23:41 +01:00
2024-11-08 11:46:27 +01:00
2026-05-30 01:49:49 +02:00
2026-05-30 01:49:49 +02:00
2026-05-30 01:49:49 +02:00