86 lines
1.5 KiB
C
86 lines
1.5 KiB
C
|
/**
|
||
|
* @copyright 2015 Indie Semiconductor.
|
||
|
*
|
||
|
* This file is proprietary to Indie Semiconductor.
|
||
|
* All rights reserved. Reproduction or distribution, in whole
|
||
|
* or in part, is forbidden except by express written permission
|
||
|
* of Indie Semiconductor.
|
||
|
*
|
||
|
* @file applicationTask.c
|
||
|
* @Author: Jack.Pan
|
||
|
* @E-mail:jack.pan@indiemicro.com
|
||
|
* @Date: 2020/09/10
|
||
|
*/
|
||
|
|
||
|
#include <applicationTask.h>
|
||
|
#include <measureTask.h>
|
||
|
#include <pdsTask.h>
|
||
|
#include <linStackTask.h>
|
||
|
|
||
|
/*static uint8_t ledNum = LED0;*/
|
||
|
static TaskState_t applState = TASK_STATE_INIT;
|
||
|
void ApplTimerExpired(SoftTimer_t *timer);
|
||
|
|
||
|
|
||
|
static uint8_t LED_State = 0U;
|
||
|
|
||
|
|
||
|
uint8_t APPL_GetLEDState(void)
|
||
|
{
|
||
|
return LED_State;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
static SoftTimer_t ApplTimer = {
|
||
|
.mode = TIMER_PERIODIC_MODE,
|
||
|
.interval = 50U,
|
||
|
.handler = ApplTimerExpired
|
||
|
};
|
||
|
|
||
|
|
||
|
void ApplTimerExpired(SoftTimer_t *timer)
|
||
|
{
|
||
|
static uint8_t index = 0U;
|
||
|
if (index == 0U){
|
||
|
index = 1U;
|
||
|
}else{
|
||
|
index = 0;
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void APPL_TaskHandler(void)
|
||
|
{
|
||
|
switch(applState){
|
||
|
case TASK_STATE_INIT:
|
||
|
SoftTimer_Start(&ApplTimer);
|
||
|
applState = TASK_STATE_ACTIVE;
|
||
|
break;
|
||
|
case TASK_STATE_ACTIVE:
|
||
|
break;
|
||
|
default:
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
void APPL_HandleControlCommands(LIN_Device_Frame_t const *frame)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
/***************************************************************/
|
||
|
|
||
|
static SoftTimer_t KeyScanTimer = {
|
||
|
.mode = TIMER_PERIODIC_MODE,
|
||
|
.interval = 5U,
|
||
|
.handler = KeyScanTimerExpired
|
||
|
};
|
||
|
|
||
|
void KeyScanTimerExpired(SoftTimer_t *timer)
|
||
|
{
|
||
|
|
||
|
|
||
|
}
|