Exemplo n.º 1
0
int main()
{
  if (! initialise_flash()){
      signal_exit_failure();
  }
  setup();

  create_compass_task();
  create_telemetry_receiver_task();
  create_draw_task();
  create_tracker_mode_task();
  vTaskStartScheduler();

  while (1) {;}
}
Exemplo n.º 2
0
int main()
{
    //check if user wants to mod flash vars
    // also setss up flash on new firmware
    // without which flash cant be modified
    if (! initialise_flash()) {
        // set heartbeat_led on permanently symbolise fail
        quan::stm32::module_enable< heartbeat_led_pin::port_type>();
        quan::stm32::apply<
        heartbeat_led_pin
        , quan::stm32::gpio::mode::output
        , quan::stm32::gpio::otype::push_pull
        , quan::stm32::gpio::pupd::none
        , quan::stm32::gpio::ospeed::slow
        , quan::stm32::gpio::ostate::high
        >();
        while (1) {
            ;
        }
    }

    mode_check();


    setup();

    //create_mavlink_task();
// create_frsky_task();
    //create_heartbeat_task();
    //create_fsk_task();
    create_draw_task();
// create_telem_task();
#if ( QUAN_OSD_BOARD_TYPE !=4)
    create_leds_task();
#endif
    vTaskStartScheduler();

    while (1) {
        ;
    }
}
Exemplo n.º 3
0
void mode_check()
{ 
   //check if user wants to mod flash vars
   if (! initialise_flash()){
      // set heartbeat_led on permanently symbolise fail
       quan::stm32::module_enable< heartbeat_led_pin::port_type>();
         quan::stm32::apply<
            heartbeat_led_pin
            , quan::stm32::gpio::mode::output
            , quan::stm32::gpio::otype::push_pull
            , quan::stm32::gpio::pupd::none
            , quan::stm32::gpio::ospeed::slow
            , quan::stm32::gpio::ostate::high
         >();
      while (1){;}
   }
  
   flash_menu_sp::init();
   input_output io;
   bool want_menu = false;
   for ( uint32_t i = 0; i < 60 ; ++i){
      // crude method of timing for a  approx 4 sec delay
      // to allow user to press return 3 x
      // after startup
      // causes a bit of flicker but keeps text static
      if ( io("Press return 3 times for Flash Menu"
             "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b") ){
         want_menu = true;
         break;
      }
   }
   if ( want_menu){
      
      do_flash_vars();
   }else{
      flash_menu_sp::write("\n\nTime is up! ... Exiting to Flight mode\n\n");
      return;
   } 
}