Fix GPS nav-solve phase seeding for cold PVT
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "gps/gps_nav_phase.h"
|
||||
|
||||
static uint32_t tracking_control_without_nav_solve_irq(void)
|
||||
{
|
||||
return (1u << GPS_TRCK_INTR_EN_POS) |
|
||||
(1u << GPS_TRCK_NAV_BITS_INTR_EN_POS) |
|
||||
(1u << GPS_TRCK_NAV_BITS_FLAG_EN_POS) |
|
||||
(1u << GPS_TRCK_STOP_UNLOCK_EN_POS) |
|
||||
(1u << GPS_TRCK_UNLOCK_INTR_EN_POS) |
|
||||
(1u << GPS_TRCK_UNLOCK_FLAG_EN_POS) |
|
||||
(1u << GPS_TRCK_NAV_SOLVE_EN_POS) |
|
||||
(1u << GPS_TRCK_MEASUREMENT_INTR_EN_POS) |
|
||||
(1u << GPS_TRCK_MEASUREMENT_FLAG_EN_POS);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
uint32_t cold_control = tracking_control_without_nav_solve_irq();
|
||||
assert(!gps_nav_phase_control_armed(cold_control));
|
||||
assert(!gps_nav_phase_preserve_seed_after_how(true, cold_control));
|
||||
assert(!gps_nav_phase_preserve_seed_after_how(false, cold_control));
|
||||
|
||||
uint32_t flag_only =
|
||||
cold_control | (1u << GPS_TRCK_NAV_SOLVE_FLAG_EN_POS);
|
||||
assert(!gps_nav_phase_control_armed(flag_only));
|
||||
assert(!gps_nav_phase_preserve_seed_after_how(true, flag_only));
|
||||
|
||||
uint32_t irq_only =
|
||||
cold_control | (1u << GPS_TRCK_NAV_SOLVE_INTR_EN_POS);
|
||||
assert(!gps_nav_phase_control_armed(irq_only));
|
||||
assert(!gps_nav_phase_preserve_seed_after_how(true, irq_only));
|
||||
|
||||
uint32_t armed_control =
|
||||
cold_control |
|
||||
(1u << GPS_TRCK_NAV_SOLVE_INTR_EN_POS) |
|
||||
(1u << GPS_TRCK_NAV_SOLVE_FLAG_EN_POS);
|
||||
assert(gps_nav_phase_control_armed(armed_control));
|
||||
assert(gps_nav_phase_preserve_seed_after_how(true, armed_control));
|
||||
assert(!gps_nav_phase_preserve_seed_after_how(false, armed_control));
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user