
#include "freerotsTask.h"


#include "uart_dev.h"
#include "HD_UART.h"
#include "FM_GPIO.h"
#include "FM_ADC.h"

#define TASK1_TASK_PRIO     5
#define TASK1_STK_SIZE      256

TaskHandle_t Task1Task_Handler;
uint8_t data[20] = "hello world\n";

void task1_task(void *pvParameters)
{
	writePwrCtrlState(Android_PwrCtrl, PwrCtrlOpen);
	proportionalInt();
    while(1) {
        // printf("task1 entry\r\n");
		printf_adc_data();
        USART_ITConfig(UART5, USART_IT_TXE, ENABLE);
	    uartInterruptSend(g_Upward_uart5_handle, data, 12);
        vTaskDelay(1000);
    }
}


/**
  * @brief  Æô¶¯
  * @param
  * @retval
  */
void startApp(void)
{
	Init_Upward_uart(115200);
	FM_GPIO_Init();
	FM_ADC_Init();

    /* create task */
    xTaskCreate((TaskFunction_t )task1_task,
                    (const char*    )"task1",
                    (uint16_t       )TASK1_STK_SIZE,
                    (void*          )NULL,
                    (UBaseType_t    )TASK1_TASK_PRIO,
                    (TaskHandle_t*  )&Task1Task_Handler);
    vTaskStartScheduler();
}




