Files
ACD528xx_Test_Project/tasks/aconnoTasks.cpp
T
2019-02-13 13:18:39 +01:00

63 lines
1.2 KiB
C++

/**
* @file aconnoTasks.cpp
* @author Jurica Resetar (Jurica@aconno.de)
* @brief
* @version 0.1
* @date 2019-01-24
*
* @copyright Copyright (c) 2019
*
*/
#include "FreeRTOS.h"
#include "aconnoTasks.h"
#include "aconnoBLE.h"
#include "nrf_gpio.h"
TaskHandle_t initTask;
TaskHandle_t blinkyTask;
TaskHandle_t blinkyTask2;
TaskHandle_t batteryServiceTaskMy;
/**< Definition of Logger thread. */
#if NRF_LOG_ENABLED
TaskHandle_t m_logger_thread;
void logger_thread(void * arg);
#endif
void logTaskFunction(void *arg)
{
#if NRF_LOG_ENABLED
if (pdPASS != xTaskCreate(logger_thread, "LOGGER", 256, NULL, 1,
&m_logger_thread))
{
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
}
NRF_LOG_INFO("Logger task started.");
#endif
while(1)
{
vTaskSuspend(NULL);
}
}
void blinkyFunction(void *arg)
{
nrf_gpio_cfg_output(BLINKY_1_LED_PIN);
while(1)
{
nrf_gpio_pin_toggle(BLINKY_1_LED_PIN);
vTaskDelay(BLINKY_1_DELAY_MS);
NRF_LOG_INFO("Blinky 1 =) ");
}
}
void blinkyFunction2(void *arg)
{
nrf_gpio_cfg_output(BLINKY_2_LED_PIN);
while(1)
{
nrf_gpio_pin_toggle(BLINKY_2_LED_PIN);
vTaskDelay(BLINKY_2_DELAY_MS);
NRF_LOG_INFO("Blinky 1 =) ");
}
}