Esempio n. 1
0
Compass::Compass(uint8_t priority) :
   scheduler_task("Compass", 4 * 512, priority)
{
    I2C2 &i2c = I2C2 :: getInstance();
    i2c.init(100);
    setRunDuration(50);
}
Esempio n. 2
0
GLCD :: GLCD(uint8_t priority) : scheduler_task("GLCD", 4096, priority)     //2048
{
    GLCD_init();
    io_drive_mode.mode=MODE_MAP;
    data_rcv.drive_mode=true;
    data_rcv.versions=true;
    data_rcv.headlights=true;
    setRunDuration(100); //run after every 100ms
}
Esempio n. 3
0
example_task::example_task() :
    scheduler_task("ex_simple", 3 * 512, PRIORITY_HIGH)
{
    /**
     * This is optional such that run() will be called every 3000ms.
     * If you don't do this, run() will be called without a delay.
     */
    setRunDuration(3000);
}
Esempio n. 4
0
bool queue_tx::init(void)
{
    // call our run() every second :
    setRunDuration(1000);

    /**
     * Create a queue, and add to mShared object by the name of "my_queue"
     * One small error is not to check for NULL from xQueueCreate()
     */
    QueueHandle_t my_queue = xQueueCreate(1, sizeof(int));
    return addSharedObject("my_queue", my_queue);
}
periodicSchedulerTask::periodicSchedulerTask(void) :
    scheduler_task("dispatcher", 512 * 3, PRIORITY_CRITICAL + PRIORITY_CRITICAL + 5)
{
    setRunDuration(1);
    setStatUpdateRate(0);

    // Create the semaphores first before creating the actual periodic tasks
    sems[prd_1Hz] = xSemaphoreCreateBinary();
    sems[prd_10Hz] = xSemaphoreCreateBinary();
    sems[prd_100Hz] = xSemaphoreCreateBinary();
    sems[prd_1000Hz] = xSemaphoreCreateBinary();

    // Create the FreeRTOS tasks, these will only run once we start giving their semaphores
    xTaskCreate(period_task_1Hz, "1Hz", PERIOD_TASKS_STACK_SIZE_BYTES/4, NULL, PRIORITY_CRITICAL + 1, NULL);
    xTaskCreate(period_task_10Hz, "10Hz", PERIOD_TASKS_STACK_SIZE_BYTES/4, NULL, PRIORITY_CRITICAL + 2, NULL);
    xTaskCreate(period_task_100Hz, "100Hz", PERIOD_TASKS_STACK_SIZE_BYTES/4, NULL, PRIORITY_CRITICAL + 3, NULL);
    xTaskCreate(period_task_1000Hz, "1000Hz", PERIOD_TASKS_STACK_SIZE_BYTES/4, NULL, PRIORITY_CRITICAL + 4, NULL);
}
Esempio n. 6
0
bool Led_Switch::taskEntry()
{
    setRunDuration(100);
    return true;
}
Esempio n. 7
0
/*************************** SWITCH CLASS FUNCTIONS ****************************/
SWITCH :: SWITCH(uint8_t priority) :scheduler_task("SWITCH", 1024, priority)
{
    sw_init();
    setRunDuration(25);
}
Esempio n. 8
0
/*************************** LIGHT CLASS FUNCTIONS ****************************/
LIGHT :: LIGHT(uint8_t priority) :scheduler_task("LIGHT", 2048, priority)
{
    light_init();
    setRunDuration(50); //run after every 50mS
}
Esempio n. 9
0
bool Bluetooth::taskEntry(void)
{
    setRunDuration(100);
    return true;
}
Esempio n. 10
0
 periodicGeoTask(uint8_t priority) : scheduler_task("periodicGeoTask", 1024, priority)
 {
     setRunDuration(61); // in milliseconds
 }
 periodicCheckpointTask(uint8_t priority) : scheduler_task("periodicCheckpointTask", 1024, priority)
 {
     setRunDuration(811); // in milliseconds
 }
Esempio n. 12
0
example_io_demo::example_io_demo() :
        scheduler_task("ex_demo", 4 * 512, PRIORITY_LOW)
{
    setRunDuration(100);
}
Esempio n. 13
0
consumer::consumer() :
    scheduler_task("consumer", 3 * 512, PRIORITY_LOW)
{
    /* We will consume data every 500ms since our run() will be called every 500ms */
    setRunDuration(500);
}