add at device ml302 && ml302 test demo && modify bearpi bsp bug
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
|
||||
/*
|
||||
* Auto generated Run-Time-Environment Configuration File
|
||||
* *** Do not modify ! ***
|
||||
*
|
||||
* Project: 'BearPi_STM32L31RC'
|
||||
* Target: 'TencentOS_tiny'
|
||||
*/
|
||||
|
||||
#ifndef RTE_COMPONENTS_H
|
||||
#define RTE_COMPONENTS_H
|
||||
|
||||
|
||||
/*
|
||||
* Define the Device Header File:
|
||||
*/
|
||||
#define CMSIS_device_header "stm32l4xx.h"
|
||||
|
||||
|
||||
|
||||
#endif /* RTE_COMPONENTS_H */
|
@@ -54,20 +54,13 @@ Purpose : This file provides emWin Interface with FreeRTOS
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
#include "GUI.h"
|
||||
|
||||
/* RT-Thread include files */
|
||||
//#include "cmsis_os.h"
|
||||
#include "tos_k.h"
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Global data
|
||||
*/
|
||||
//static osMutexId osMutex;
|
||||
//static osSemaphoreId osSemaphore;
|
||||
/*<2A><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
static k_mutex_t osMutex ;
|
||||
/*<2A><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ź<EFBFBD><C5BA><EFBFBD>*/
|
||||
static k_sem_t osSemaphore ;
|
||||
/*********************************************************************
|
||||
*
|
||||
@@ -82,13 +75,11 @@ and delay function. Default time unit (tick), normally is
|
||||
|
||||
int GUI_X_GetTime(void)
|
||||
{
|
||||
//return ((int) xTaskGetTickCount());
|
||||
return (int)tos_systick_get();
|
||||
}
|
||||
|
||||
void GUI_X_Delay(int ms)
|
||||
{
|
||||
//vTaskDelay( ms );
|
||||
tos_sleep_ms(ms);
|
||||
}
|
||||
|
||||
@@ -140,51 +131,35 @@ void GUI_X_ExecIdle(void) {
|
||||
#include <stdio.h>
|
||||
void GUI_X_InitOS(void)
|
||||
{
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD><C5BA><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>*/
|
||||
//osMutex = rt_mutex_create("osMutex", RT_IPC_FLAG_FIFO);
|
||||
//RT_ASSERT(osMutex != RT_NULL);
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD><C5BA><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
//osSemaphore = rt_sem_create("osSem", 0, RT_IPC_FLAG_FIFO);
|
||||
//RT_ASSERT(osSemaphore != RT_NULL);
|
||||
tos_mutex_create(&osMutex);
|
||||
tos_sem_create(&osSemaphore,1);
|
||||
}
|
||||
|
||||
void GUI_X_Unlock(void)
|
||||
{
|
||||
//osMutexRelease(osMutex);
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
tos_mutex_post(&osMutex);
|
||||
}
|
||||
|
||||
void GUI_X_Lock(void)
|
||||
{
|
||||
//osMutexWait(osMutex , osWaitForever) ;
|
||||
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
tos_mutex_pend(&osMutex);
|
||||
}
|
||||
|
||||
/* Get Task handle */
|
||||
U32 GUI_X_GetTaskId(void)
|
||||
{
|
||||
//return ((U32) osThreadGetId());
|
||||
/*<2A><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD>߳̾<DFB3><CCBE><EFBFBD>*/
|
||||
return (U32) tos_task_curr_task_get();
|
||||
}
|
||||
|
||||
|
||||
void GUI_X_WaitEvent (void)
|
||||
{
|
||||
// osSemaphoreWait(osSemaphore , osWaitForever) ;
|
||||
/*<2A><>ȡ<EFBFBD>ź<EFBFBD><C5BA><EFBFBD>*/
|
||||
tos_sem_pend(&osSemaphore,TOS_TIME_FOREVER);
|
||||
}
|
||||
|
||||
|
||||
void GUI_X_SignalEvent (void)
|
||||
{
|
||||
//osMutexRelease(osSemaphore);
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD><C5BA><EFBFBD>*/
|
||||
tos_sem_post(&osSemaphore);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user