Exemplo n.º 1
0
/*
 * OSD additional data frame, 1 Hz rate
 *  This frame will be ignored by Ghettostation, but processed by GhettOSD if it is used as standalone onboard OSD
 *  home pos, home alt, direction to home
 */
static void ltm_oframe()
{
    ltm_initialise_packet('O');
#if defined(GPS)
    ltm_serialise_32(GPS_home[LAT]);
    ltm_serialise_32(GPS_home[LON]);
#else
    ltm_serialise_32(0);
    ltm_serialise_32(0);
#endif
    ltm_serialise_32(0);                // Don't have GPS home altitude
    ltm_serialise_8(1);                 // OSD always ON
    ltm_serialise_8(STATE(GPS_FIX_HOME) ? 1 : 0);
    ltm_finalise();
}
Exemplo n.º 2
0
static void process_ltm(void)
{
    static uint8_t ltm_scheduler = 0;
    uint8_t current_schedule = ltm_schedule[ltm_scheduler];

    sbuf_t ltmPayloadBuf;
    sbuf_t *dst = &ltmPayloadBuf;

    if (current_schedule & LTM_BIT_AFRAME) {
        ltm_initialise_packet(dst);
        ltm_aframe(dst);
        ltm_finalise(dst);
    }

#if defined(GPS)
    if (current_schedule & LTM_BIT_GFRAME) {
        ltm_initialise_packet(dst);
        ltm_gframe(dst);
        ltm_finalise(dst);
    }

    if (current_schedule & LTM_BIT_OFRAME) {
        ltm_initialise_packet(dst);
        ltm_oframe(dst);
        ltm_finalise(dst);
    }

    if (current_schedule & LTM_BIT_XFRAME) {
        ltm_initialise_packet(dst);
        ltm_xframe(dst);
        ltm_finalise(dst);
    }
#endif

    if (current_schedule & LTM_BIT_SFRAME) {
        ltm_initialise_packet(dst);
        ltm_sframe(dst);
        ltm_finalise(dst);
    }

#if defined(NAV)
    if (current_schedule & LTM_BIT_NFRAME) {
        ltm_initialise_packet(dst);
        ltm_nframe(dst);
        ltm_finalise(dst);
    }
#endif

    ltm_scheduler = (ltm_scheduler + 1) % 10;
}