add tos_slist.h, rename tos.h to tos_k.h

This commit is contained in:
daishengdong
2020-01-03 17:25:38 +08:00
parent af07f199d9
commit c9556307df
268 changed files with 900 additions and 742 deletions

View File

@@ -8,7 +8,7 @@
#include "stm32f1xx_hal.h"
#include "usart.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f1xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -63,7 +63,7 @@
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M3 Processor Interruption and Exception Handlers */
/* Cortex-M3 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.

View File

@@ -8,7 +8,7 @@
#include "stm32f7xx_hal.h"
#include "usart.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -34,7 +34,7 @@
#include "stm32f7xx_hal.h"
#include "stm32f7xx.h"
#include "stm32f7xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
@@ -42,7 +42,7 @@
/* External variables --------------------------------------------------------*/
/******************************************************************************/
/* Cortex-M7 Processor Interruption and Exception Handlers */
/* Cortex-M7 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**

View File

@@ -1,4 +1,4 @@
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#if TOS_CFG_PWR_MGR_EN > 0u

View File

@@ -1,4 +1,4 @@
#include "tos.h"
#include "tos_k.h"
#include "tickless/bsp_pm_device.h"
#include "tickless/bsp_tickless_alarm.h"

View File

@@ -1,4 +1,4 @@
#include "tos.h"
#include "tos_k.h"
#include "stm32f7xx_hal.h"
#include "stm32f7xx_hal_tim.h"
@@ -159,7 +159,7 @@ static HAL_StatusTypeDef tickless_rtc_time_set(uint8_t hour, uint8_t minu, uint8
rtc_time.TimeFormat = format;
rtc_time.DayLightSaving = RTC_DAYLIGHTSAVING_NONE;
rtc_time.StoreOperation = RTC_STOREOPERATION_RESET;
return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN);
return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN);
}
static HAL_StatusTypeDef tickless_rtc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week)
@@ -256,7 +256,7 @@ void HAL_RTC_MspInit(RTC_HandleTypeDef *rtc_handler)
void RTC_WKUP_IRQHandler(void)
{
HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler);
HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler);
}
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *rtc_handler)
@@ -333,11 +333,11 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond)
// __HAL_PWR_GET_FLAG(PWR_FLAG_WU)
__HAL_RCC_AHB1_FORCE_RESET(); //<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>IO<49><4F>
__HAL_RCC_AHB1_FORCE_RESET(); //<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>IO<49><4F>
__HAL_RCC_PWR_CLK_ENABLE(); //ʹ<><CAB9>PWRʱ<52><CAB1>
// __HAL_RCC_BACKUPRESET_FORCE(); //<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
HAL_PWR_EnableBkUpAccess(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>
HAL_PWR_EnableBkUpAccess(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
__HAL_RTC_WRITEPROTECTION_DISABLE(&rtc_handler);//<2F>ر<EFBFBD>RTCд<43><D0B4><EFBFBD><EFBFBD>
@@ -351,7 +351,7 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond)
//<2F><><EFBFBD><EFBFBD>RTC<54><43><EFBFBD><EFBFBD><EFBFBD>жϱ<D0B6>־λ
__HAL_RTC_ALARM_CLEAR_FLAG(&rtc_handler,RTC_FLAG_ALRAF|RTC_FLAG_ALRBF);
__HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF);
__HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF);
__HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&rtc_handler,RTC_FLAG_WUTF);
// __HAL_RCC_BACKUPRESET_RELEASE(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>

View File

@@ -8,7 +8,7 @@
#include "stm32f4xx_hal.h"
#include "usart.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f4xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -63,7 +63,7 @@ extern UART_HandleTypeDef huart1;
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M4 Processor Interruption and Exception Handlers */
/* Cortex-M4 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -186,11 +186,11 @@ void SysTick_Handler(void)
/* USER CODE END SysTick_IRQn 0 */
HAL_IncTick();
if(tos_knl_is_running())
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_knl_irq_leave();
tos_knl_irq_enter();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -8,7 +8,7 @@
#include "stm32f1xx_hal.h"
#include "usart.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f1xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -63,7 +63,7 @@ extern UART_HandleTypeDef huart1;
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M3 Processor Interruption and Exception Handlers */
/* Cortex-M3 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.

View File

@@ -10,7 +10,7 @@ extern "C" {
#include "usart.h"
#include "gpio.h"
#include "spi.h"
#include "tos.h"
#include "tos_k.h"
#include "lcd.h"
void board_init(void);

View File

@@ -23,7 +23,7 @@
#include "stm32l4xx_it.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "tos.h"
#include "tos_k.h"
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN TD */
@@ -32,7 +32,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -62,7 +62,7 @@
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M4 Processor Interruption and Exception Handlers */
/* Cortex-M4 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.

View File

@@ -13,7 +13,7 @@
#include "usart.h"
#include "gpio.h"
#include "rng.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -20,7 +20,7 @@
/* Includes ------------------------------------------------------------------*/
#include "bsp_eth.h"
#include "main.h"
#include "tos.h"
#include "tos_k.h"
#include "lwip/opt.h"
#include "lwip/timeouts.h"
#include "netif/ethernet.h"

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f4xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -63,7 +63,7 @@ extern UART_HandleTypeDef huart1;
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M4 Processor Interruption and Exception Handlers */
/* Cortex-M4 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -175,8 +175,8 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_knl_irq_leave();
tos_tick_handler();
tos_knl_irq_leave();
}
//HAL_SYSTICK_IRQHandler();
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -1,4 +1,4 @@
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#if TOS_CFG_PWR_MGR_EN > 0u

View File

@@ -1,4 +1,4 @@
#include "tos.h"
#include "tos_k.h"
#include "tickless/bsp_pm_device.h"
#include "tickless/bsp_tickless_alarm.h"

View File

@@ -1,4 +1,4 @@
#include "tos.h"
#include "tos_k.h"
#include "stm32f4xx_hal.h"
#include "stm32f4xx_hal_tim.h"
@@ -158,7 +158,7 @@ static HAL_StatusTypeDef tickless_rtc_time_set(uint8_t hour, uint8_t minu, uint8
rtc_time.TimeFormat = format;
rtc_time.DayLightSaving = RTC_DAYLIGHTSAVING_NONE;
rtc_time.StoreOperation = RTC_STOREOPERATION_RESET;
return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN);
return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN);
}
static HAL_StatusTypeDef tickless_rtc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week)
@@ -255,7 +255,7 @@ void HAL_RTC_MspInit(RTC_HandleTypeDef *rtc_handler)
void RTC_WKUP_IRQHandler(void)
{
HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler);
HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler);
}
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *rtc_handler)
@@ -332,11 +332,11 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond)
// __HAL_PWR_GET_FLAG(PWR_FLAG_WU)
__HAL_RCC_AHB1_FORCE_RESET(); //<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>IO<49><4F>
__HAL_RCC_AHB1_FORCE_RESET(); //<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>IO<49><4F>
__HAL_RCC_PWR_CLK_ENABLE(); //ʹ<><CAB9>PWRʱ<52><CAB1>
// __HAL_RCC_BACKUPRESET_FORCE(); //<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
HAL_PWR_EnableBkUpAccess(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>
HAL_PWR_EnableBkUpAccess(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
__HAL_RTC_WRITEPROTECTION_DISABLE(&rtc_handler);//<2F>ر<EFBFBD>RTCд<43><D0B4><EFBFBD><EFBFBD>
@@ -350,7 +350,7 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond)
//<2F><><EFBFBD><EFBFBD>RTC<54><43><EFBFBD><EFBFBD><EFBFBD>жϱ<D0B6>־λ
__HAL_RTC_ALARM_CLEAR_FLAG(&rtc_handler,RTC_FLAG_ALRAF|RTC_FLAG_ALRBF);
__HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF);
__HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF);
__HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&rtc_handler,RTC_FLAG_WUTF);
// __HAL_RCC_BACKUPRESET_RELEASE(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>

View File

@@ -8,7 +8,7 @@
#include "stm32f1xx_hal.h"
#include "usart.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f1xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -63,7 +63,7 @@ extern UART_HandleTypeDef huart1;
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M3 Processor Interruption and Exception Handlers */
/* Cortex-M3 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.

View File

@@ -12,7 +12,7 @@
#include "gpio.h"
#include "lcd_spi2_drv.h"
#include "bh1750.h"
#include "tos.h"
#include "tos_k.h"
void m26_power_on(void);
void board_init(void);

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32l4xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -65,7 +65,7 @@ extern UART_HandleTypeDef huart3;
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M4 Processor Interruption and Exception Handlers */
/* Cortex-M4 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32l4xx_it.h"
#include "tos.h"
#include "tos_k.h"
#include "tos_at.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
@@ -34,7 +34,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -66,7 +66,7 @@ extern UART_HandleTypeDef huart3;
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M4 Processor Interruption and Exception Handlers */
/* Cortex-M4 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.

View File

@@ -1,4 +1,4 @@
#include "tos.h"
#include "tos_k.h"
#include "mcu_init.h"
#if TOS_CFG_PWR_MGR_EN > 0u

View File

@@ -1,4 +1,4 @@
#include "tos.h"
#include "tos_k.h"
#include "tickless/bsp_pm_device.h"
#include "tickless/bsp_tickless_alarm.h"

View File

@@ -1,4 +1,4 @@
#include "tos.h"
#include "tos_k.h"
#include "stm32l4xx_hal.h"
#include "stm32l4xx_hal_tim.h"
@@ -96,7 +96,7 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *tim_handler)
/* TIM6 interrupt Deinit */
HAL_NVIC_DisableIRQ(TIM6_DAC_IRQn);
}
}
}
static int tickless_tim6_wkup_alarm_init(void)
{
@@ -177,7 +177,7 @@ static HAL_StatusTypeDef tickless_rtc_time_set(uint8_t hour, uint8_t minu, uint8
rtc_time.TimeFormat = format;
rtc_time.DayLightSaving = RTC_DAYLIGHTSAVING_NONE;
rtc_time.StoreOperation = RTC_STOREOPERATION_RESET;
return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN);
return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN);
}
static HAL_StatusTypeDef tickless_rtc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week)
@@ -274,7 +274,7 @@ void HAL_RTC_MspInit(RTC_HandleTypeDef *rtc_handler)
void RTC_WKUP_IRQHandler(void)
{
HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler);
HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler);
}
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *rtc_handler)
@@ -355,11 +355,11 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond)
// __HAL_PWR_GET_FLAG(PWR_FLAG_WU)
__HAL_RCC_AHB1_FORCE_RESET(); //<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>IO<49><4F>
__HAL_RCC_AHB1_FORCE_RESET(); //<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>IO<49><4F>
__HAL_RCC_PWR_CLK_ENABLE(); //ʹ<><CAB9>PWRʱ<52><CAB1>
// __HAL_RCC_BACKUPRESET_FORCE(); //<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
HAL_PWR_EnableBkUpAccess(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>
HAL_PWR_EnableBkUpAccess(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
__HAL_RTC_WRITEPROTECTION_DISABLE(&rtc_handler);//<2F>ر<EFBFBD>RTCд<43><D0B4><EFBFBD><EFBFBD>
@@ -373,7 +373,7 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond)
//<2F><><EFBFBD><EFBFBD>RTC<54><43><EFBFBD><EFBFBD><EFBFBD>жϱ<D0B6>־λ
__HAL_RTC_ALARM_CLEAR_FLAG(&rtc_handler,RTC_FLAG_ALRAF|RTC_FLAG_ALRBF);
__HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF);
__HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF);
__HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&rtc_handler,RTC_FLAG_WUTF);
// __HAL_RCC_BACKUPRESET_RELEASE(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>

View File

@@ -13,7 +13,7 @@
#include "usart.h"
#include "usb.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -34,7 +34,7 @@
#include "stm32f1xx_hal.h"
#include "stm32f1xx.h"
#include "stm32f1xx_it.h"
#include "tos.h"
#include "tos_k.h"
#include "usart.h"
/* USER CODE BEGIN 0 */
@@ -47,7 +47,7 @@ extern UART_HandleTypeDef huart2;
extern UART_HandleTypeDef huart3;
/******************************************************************************/
/* Cortex-M3 Processor Interruption and Exception Handlers */
/* Cortex-M3 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**

View File

@@ -12,7 +12,7 @@
#include "gd32f4xx_it.h"
#include "main.h"
#include "systick.h"
#include "tos.h"
#include "tos_k.h"
/*!
\brief this function handles NMI exception
@@ -117,7 +117,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
delay_decrement();

View File

@@ -1,7 +1,7 @@
/*!
\file gd32e10x_it.c
\brief interrupt service routines
\version 2018-03-26, V1.0.0, demo for GD32E103
*/
@@ -10,33 +10,33 @@
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
*/
#include "gd32e10x_it.h"
#include "systick.h"
#include "tos.h"
#include "tos_k.h"
/*!
\brief this function handles NMI exception
\param[in] none
@@ -131,7 +131,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
delay_decrement();

View File

@@ -1,7 +1,7 @@
/*!
\file gd32e23x_it.c
\brief interrupt service routines
\version 2019-02-19, V1.0.0, firmware for GD32E23x
*/
@@ -10,33 +10,33 @@
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
*/
#include "gd32e23x_it.h"
#include "systick.h"
#include "tos.h"
#include "tos_k.h"
/*!
\brief this function handles NMI exception
\param[in] none
@@ -132,7 +132,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running()) //OS<4F><53>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>,<2C><>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><C4B5>ȴ<EFBFBD><C8B4><EFBFBD>
{
tos_knl_irq_enter(); //<2F><><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>
tos_tick_handler(); //<2F><><EFBFBD><EFBFBD>TencentOS tiny<6E><79>ʱ<EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
tos_tick_handler(); //<2F><><EFBFBD><EFBFBD>TencentOS tiny<6E><79>ʱ<EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
tos_knl_irq_leave(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><D0BB><EFBFBD><EFBFBD>ж<EFBFBD>
}
delay_decrement();

View File

@@ -15,7 +15,7 @@
#include "gd32f1x0_it.h"
#include "main.h"
#include "systick.h"
#include "tos.h"
#include "tos_k.h"
/*!
\brief this function handles NMI exception
\param[in] none
@@ -110,7 +110,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
delay_decrement();

View File

@@ -12,34 +12,34 @@
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
*/
#include "gd32f20x_it.h"
#include "main.h"
#include "systick.h"
#include "tos.h"
#include "tos_k.h"
/*!
\brief this function handles NMI exception
\param[in] none
@@ -143,7 +143,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running()) //OS<4F><53>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>,<2C><>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><C4B5>ȴ<EFBFBD><C8B4><EFBFBD>
{
tos_knl_irq_enter(); //<2F><><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>
tos_tick_handler(); //<2F><><EFBFBD><EFBFBD>TencentOS tiny<6E><79>ʱ<EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
tos_tick_handler(); //<2F><><EFBFBD><EFBFBD>TencentOS tiny<6E><79>ʱ<EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
tos_knl_irq_leave(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><D0BB><EFBFBD><EFBFBD>ж<EFBFBD>
}
delay_decrement();

View File

@@ -12,34 +12,34 @@
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
*/
#include "gd32f30x_it.h"
#include "main.h"
#include "systick.h"
#include "tos.h"
#include "tos_k.h"
/*!
\brief this function handles NMI exception
\param[in] none
@@ -134,7 +134,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
delay_decrement();

View File

@@ -1,4 +1,4 @@
#include "tos.h"
#include "tos_k.h"
// systick handler
void eclic_mtip_handler() {

View File

@@ -1,5 +1,5 @@
#include "mcu_init.h"
#include "tos.h"
#include "tos_k.h"
#define TASK_SIZE 1024
k_task_t k_task_task1;

View File

@@ -1,4 +1,4 @@
#include "tos.h"
#include "tos_k.h"
// systick handler
void eclic_mtip_handler() {

View File

@@ -1,5 +1,5 @@
#include "mcu_init.h"
#include "tos.h"
#include "tos_k.h"
#define TASK_SIZE 1024
k_task_t k_task_task1;

View File

@@ -9,7 +9,7 @@
#include "i2c.h"
#include "usart.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -18,7 +18,7 @@
#ifndef _TOS_AT_H_
#define _TOS_AT_H_
#include "tos.h"
#include "tos_k.h"
#include "tos_at_utils.h"
#include "tos_hal.h"
@@ -268,7 +268,7 @@ int tos_at_init(hal_uart_port_t uart_port, at_event_t *event_table, size_t event
*
* @attention None
*
* @return
* @return
None
*/
void tos_at_deinit(void);

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f1xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -65,7 +65,7 @@ extern UART_HandleTypeDef huart3;
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M3 Processor Interruption and Exception Handlers */
/* Cortex-M3 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -190,8 +190,8 @@ void SysTick_Handler(void)
HAL_IncTick();
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_knl_irq_enter();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f1xx_it.h"
#include "tos.h"
#include "tos_k.h"
#include "tos_at.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
@@ -34,7 +34,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -66,7 +66,7 @@ extern UART_HandleTypeDef huart3;
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M3 Processor Interruption and Exception Handlers */
/* Cortex-M3 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -191,8 +191,8 @@ void SysTick_Handler(void)
HAL_IncTick();
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_knl_irq_enter();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -34,7 +34,7 @@
#include "n32g020xx_log.h"
#include "tos_at.h"
/* USER CODE BEGIN 0 */
#include <tos.h>
#include <tos_k.h>
/* USER CODE END 0 */
@@ -98,7 +98,7 @@ void SysTick_Handler(void) {
/* USER CODE END SysTick_IRQn 1 */
}
void AT_UART_DataParse(char byte)
void AT_UART_DataParse(char byte)
{
tos_at_uart_write_byte(byte);
}

View File

@@ -8,7 +8,7 @@
#include "stm32f0xx_hal.h"
#include "usart.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f0xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -63,7 +63,7 @@
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M0 Processor Interruption and Exception Handlers */
/* Cortex-M0 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -131,7 +131,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -8,7 +8,7 @@
#include "stm32f1xx_hal.h"
#include "usart.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f1xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -63,7 +63,7 @@
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M3 Processor Interruption and Exception Handlers */
/* Cortex-M3 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -188,8 +188,8 @@ void SysTick_Handler(void)
HAL_IncTick();
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_knl_irq_enter();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -8,7 +8,7 @@
#include "stm32f4xx_hal.h"
#include "usart.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -23,7 +23,7 @@
#include "stm32f4xx_it.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "tos.h"
#include "tos_k.h"
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -63,7 +63,7 @@
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M4 Processor Interruption and Exception Handlers */
/* Cortex-M4 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -189,7 +189,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -10,7 +10,7 @@
#include "gpio.h"
#include "bsp_eth.h"
#include "usb_otg.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -20,7 +20,7 @@
/* Includes ------------------------------------------------------------------*/
#include "bsp_eth.h"
#include "main.h"
#include "tos.h"
#include "tos_k.h"
#include "lwip/opt.h"
#include "lwip/timeouts.h"
#include "netif/ethernet.h"

View File

@@ -1,4 +1,4 @@
#include "tos.h"
#include "tos_k.h"
#include <stdint.h>
#include <stdio.h>

View File

@@ -21,11 +21,11 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f7xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN TD */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -64,7 +64,7 @@ extern ETH_HandleTypeDef heth;
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M7 Processor Interruption and Exception Handlers */
/* Cortex-M7 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -190,7 +190,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -21,11 +21,11 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f7xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN TD */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -64,7 +64,7 @@ extern ETH_HandleTypeDef heth;
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M7 Processor Interruption and Exception Handlers */
/* Cortex-M7 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -190,7 +190,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -8,7 +8,7 @@
#include "stm32g0xx_hal.h"
#include "usart.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32g0xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -63,7 +63,7 @@
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M0+ Processor Interruption and Exception Handlers */
/* Cortex-M0+ Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -131,7 +131,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -8,7 +8,7 @@
#include "stm32g0xx_hal.h"
#include "usart.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32g0xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -63,7 +63,7 @@
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M0+ Processor Interruption and Exception Handlers */
/* Cortex-M0+ Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -131,7 +131,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -10,7 +10,7 @@
#include "i2c.h"
#include "gpio.h"
#include "rhf76_lora.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -1,5 +1,5 @@
#include "rhf76_lora.h"
#include "tos.h"
#include "tos_k.h"
uint16_t rx_rd_index = 0;
uint16_t rx_wr_index = 0;
@@ -89,8 +89,8 @@ bool rhf76_send_cmd(char * cmd, uint32_t len,char * reply1, char * reply2, uint3
dev_uart_recv((uint8_t *)buf, 120, 20);
printf("%s",buf);
if ( ( reply1 != 0 ) && ( reply2 != 0 ) )
return ( ( bool ) strstr ( buf, reply1 ) ||
( bool ) strstr ( buf, reply2 ) );
return ( ( bool ) strstr ( buf, reply1 ) ||
( bool ) strstr ( buf, reply2 ) );
else if ( reply1 != 0 )
return ( ( bool ) strstr ( buf, reply1 ) );
@@ -155,7 +155,7 @@ void rhf76_set_class ( ENUM_CLASS_TypeDef type )
break;
default:
break;
}
}
}
void rhf76_set_chanel(void)
@@ -250,7 +250,7 @@ static void __hex2str(uint8_t *in, char *out, int len)
}
int rhf76_send(const void *buf, uint32_t len)
{
{
char *str_buf = NULL;
str_buf = tos_mmheap_calloc(2 * len + 1, sizeof(char));
@@ -258,13 +258,13 @@ int rhf76_send(const void *buf, uint32_t len)
return -1;
}
__hex2str((uint8_t *)buf, str_buf, len);
char cmd[100] = {0};
snprintf(cmd, sizeof(cmd), "AT+CMSGHEX=\"%s\"\r\n", str_buf);
cmd[sizeof(cmd) - 1] = '\0';
tos_mmheap_free(str_buf);
rhf76_send_cmd((char *)cmd, strlen(cmd), (char *)"ACK Received","Done",10000);
return len;
return len;
}

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32l0xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -64,7 +64,7 @@ extern UART_HandleTypeDef huart2;
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M0+ Processor Interruption and Exception Handlers */
/* Cortex-M0+ Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -132,7 +132,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32l0xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -64,7 +64,7 @@ extern UART_HandleTypeDef huart2;
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M0+ Processor Interruption and Exception Handlers */
/* Cortex-M0+ Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -132,7 +132,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -8,7 +8,7 @@
#include "stm32l0xx_hal.h"
#include "usart.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
#include "i2c.h"
void board_init(void);

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32l0xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -64,7 +64,7 @@ extern UART_HandleTypeDef huart2;
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M0+ Processor Interruption and Exception Handlers */
/* Cortex-M0+ Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable Interrupt.
@@ -132,7 +132,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32l0xx_it.h"
#include "tos.h"
#include "tos_k.h"
#include "tos_at.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
@@ -34,7 +34,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -65,7 +65,7 @@ extern UART_HandleTypeDef huart2;
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M0+ Processor Interruption and Exception Handlers */
/* Cortex-M0+ Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable Interrupt.
@@ -133,7 +133,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -8,7 +8,7 @@
#include "stm32l4xx_hal.h"
#include "usart.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32l4xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -63,7 +63,7 @@
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M4 Processor Interruption and Exception Handlers */
/* Cortex-M4 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -189,7 +189,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -8,7 +8,7 @@
#include "stm32l4xx_hal.h"
#include "usart.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32l4xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -63,7 +63,7 @@
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M4 Processor Interruption and Exception Handlers */
/* Cortex-M4 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -189,7 +189,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32l4xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -63,7 +63,7 @@
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M4 Processor Interruption and Exception Handlers */
/* Cortex-M4 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.

View File

@@ -8,7 +8,7 @@
#include "stm32l4xx_hal.h"
#include "usart.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32l4xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -63,7 +63,7 @@
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M4 Processor Interruption and Exception Handlers */
/* Cortex-M4 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -189,7 +189,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -8,7 +8,7 @@
#include "stm32l4xx_hal.h"
#include "usart.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32l4xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -63,7 +63,7 @@
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M4 Processor Interruption and Exception Handlers */
/* Cortex-M4 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -189,7 +189,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -57,7 +57,7 @@ board: FRDM-KL27Z
#include "fsl_smc.h"
#include "clock_config.h"
#include "tos.h"
#include "tos_k.h"
/*******************************************************************************
* Definitions
******************************************************************************/
@@ -234,7 +234,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -68,7 +68,7 @@ board: FRDM-KL25Z
#include "fsl_smc.h"
#include "clock_config.h"
#include "tos.h"
#include "tos_k.h"
/*******************************************************************************
* Definitions
******************************************************************************/
@@ -195,7 +195,7 @@ void BOARD_BootClockRUN(void)
&mcgConfig_BOARD_BootClockRUN.pll0Config);
/* Configure the Internal Reference clock (MCGIRCLK). */
CLOCK_SetInternalRefClkConfig(mcgConfig_BOARD_BootClockRUN.irclkEnableMode,
mcgConfig_BOARD_BootClockRUN.ircs,
mcgConfig_BOARD_BootClockRUN.ircs,
mcgConfig_BOARD_BootClockRUN.fcrdiv);
/* Set the clock configuration in SIM module. */
CLOCK_SetSimConfig(&simConfig_BOARD_BootClockRUN);
@@ -302,7 +302,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -54,7 +54,7 @@ processor_version: 0.0.1
#include "fsl_power.h"
#include "fsl_clock.h"
#include "clock_config.h"
#include "tos.h"
#include "tos_k.h"
/*******************************************************************************
* Definitions
******************************************************************************/
@@ -167,7 +167,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -13,7 +13,7 @@
#define MAIN_H
#include "tos.h"
#include "tos_k.h"
#include "nrf_gpio.h"
#define LED_START 18

View File

@@ -13,7 +13,7 @@
#define MAIN_H
#include "tos.h"
#include "tos_k.h"
#include "nrf_gpio.h"
#define LED_START 18

View File

@@ -7,7 +7,7 @@
#include "nrf.h"
#include "nrfx_glue.h"
#include <tos.h>
#include <tos_k.h>
#define NUM_IRQS_PER_REG 32
#define REG_FROM_IRQ(irq) (irq / NUM_IRQS_PER_REG)

View File

@@ -12,7 +12,7 @@
#ifndef MAIN_H
#define MAIN_H
#include "tos.h"
#include "tos_k.h"
#include "nrf_gpio.h"
#define LED_START 18

View File

@@ -7,7 +7,7 @@
#include "nrf.h"
#include "nrfx_glue.h"
#include <tos.h>
#include <tos_k.h>
#define NUM_IRQS_PER_REG 32
#define REG_FROM_IRQ(irq) (irq / NUM_IRQS_PER_REG)

View File

@@ -1,13 +1,13 @@
#include "stdio.h"
#include "NuMicro.h"
#include "tos.h"
#include "tos_k.h"
#define task1_size 240 // size of task1 stack
#define task2_size 240
#define task2_size 240
k_task_t task1; //structure of task1
k_task_t task2;
k_task_t task2;
k_stack_t task1_stack[task1_size]; //stack of task1
k_stack_t task2_stack[task2_size];
k_stack_t task2_stack[task2_size];
void SYS_Init(void)
{
@@ -16,28 +16,28 @@ void SYS_Init(void)
/*---------------------------------------------------------------------------------------------------------*/
/* Unlock protected registers */
SYS_UnlockReg();
/* Set XT1_OUT(PF.2) and XT1_IN(PF.3) to input mode to prevent leakage */
PF->MODE &= ~(GPIO_MODE_MODE2_Msk | GPIO_MODE_MODE3_Msk);
/* Disable digital input path of analog pin XT1_OUT to prevent leakage */
GPIO_DISABLE_DIGITAL_PATH(PF, BIT2 | BIT3);
/* Enable<6C><65> HXT clock */
CLK_EnableXtalRC(CLK_PWRCTL_HXTEN_Msk);
CLK_EnableXtalRC(CLK_PWRCTL_HXTEN_Msk);
/* Switch HCLK clock source to external */
CLK_SetHCLK(CLK_CLKSEL0_HCLKSEL_HXT, CLK_CLKDIV0_HCLK(1)); //here switch zhe MCU clock to external
/*Set the core clock freq*/
CLK_SetCoreClock(FREQ_32MHZ); //set the core clock freq,should not higher than your HCLK clock freq
/* Enable UART module clock */
CLK_EnableModuleClock(UART0_MODULE);
/* Select UART module clock source as HIRC and UART module clock divider as 1 */
CLK_SetModuleClock(UART0_MODULE, CLK_CLKSEL1_UART0SEL_HIRC, CLK_CLKDIV0_UART0(1));
/*---------------------------------------------------------------------------------------------------------*/
/* Init I/O Multi-function */
/*---------------------------------------------------------------------------------------------------------*/
@@ -62,9 +62,9 @@ void task1_fun(void *Parameter)
while(1)
{
printf("Task1 <20><>Thansplant CORTEX-M23 Succeed\r\n");
PB14 =~ PB14;
tos_task_delay(1000);
printf("Task1 <20><>Thansplant CORTEX-M23 Succeed\r\n");
PB14 =~ PB14;
tos_task_delay(1000);
}
}
@@ -74,9 +74,9 @@ void task2_task(void *Parameter)
k_err_t err;
while(1)
{
printf("Task2: hello world, hello Nuvoton \r\n");
tos_task_delay(100);
{
printf("Task2: hello world, hello Nuvoton \r\n");
tos_task_delay(100);
}
}
@@ -88,17 +88,17 @@ int main()
/* Init System, peripheral clock and multi-function I/O */
SYS_Init();
tos_knl_init(); //tos init ,include SystickInit,should init after protected registers unlock
/* Lock protected registers */
SYS_LockReg();
/* Init UART0 for printf */
UART0_Init();
printf("system clock to %d Hz, PLL clock to %d Hz...................... ", SystemCoreClock, CLK_SetCoreClock(FREQ_32MHZ));
GPIO_SetMode(PB, BIT14, GPIO_MODE_OUTPUT);
err = tos_task_create(
@@ -111,21 +111,21 @@ int main()
task1_size,
100
);
err = tos_task_create(
&task2,
"display",
task2_task,
NULL,
2,
task2_stack,
task2_size,
100);
&task2,
"display",
task2_task,
NULL,
2,
task2_stack,
task2_size,
100);
if(err != K_ERR_NONE)
printf("TenentOS creat task fail! code is %d\r\n",err);
tos_knl_start(); //Start TOS TINY
}

View File

@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdint.h>
#include "M251.h"
#include "tos.h" //include tos.h
#include "tos_k.h"
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
#include "partition_M251.h"
#endif

View File

@@ -1,4 +1,4 @@
#include "tos.h"
#include "tos_k.h"
void SysTick_IRQHandler() {
port_systick_config((uint32_t)k_cpu_cycle_per_tick);
if (tos_knl_is_running()) {

View File

@@ -1,4 +1,4 @@
#include "tos.h"
#include "tos_k.h"
#define TASK_SIZE 512
k_task_t k_task_task1;

View File

@@ -33,7 +33,7 @@
#include "rtc-board.h"
#include "sx1276-board.h"
#include "board.h"
#include "tos.h"
#include "tos_k.h"
/*!
* Unique Devices IDs register set ( STM32L0xxx )
*/
@@ -335,7 +335,7 @@ void SysTick_Handler( void )
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
//HAL_SYSTICK_IRQHandler( );
@@ -410,7 +410,7 @@ void BoardLowPowerHandler( void )
{
__disable_irq( );
/*!
* If an interrupt has occurred after __disable_irq( ), it is kept pending
* If an interrupt has occurred after __disable_irq( ), it is kept pending
* and cortex will not enter low power anyway
*/

View File

@@ -1,7 +1,7 @@
#include "LoRaApi.h"
#include <stdio.h>
#include <string.h>
#include "tos.h"
#include "tos_k.h"
#include "atcmd-board.h"
/*LORA<52><41><EFBFBD><EFBFBD>״̬*/
uint8_t g_join_state = 0;
@@ -11,11 +11,11 @@ uint32_t g_rx_num = 0;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȼ<EFBFBD>
#define TASK1_PRIO 3
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ջ<EFBFBD><D5BB>С
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ջ<EFBFBD><D5BB>С
#define TASK1_STK_SIZE (1024 * 4)
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƿ<EFBFBD>
k_task_t Task1TCB;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ջ
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ջ
k_stack_t TASK1_STK[TASK1_STK_SIZE];
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void task1(void *arg);
@@ -58,7 +58,7 @@ void task1(void *arg)
Lora_Send(0, 2, tmpbuf, sizeof(tmpbuf));
g_rx_num++;
}
}
}
at_cmd_handle();
}
}

View File

@@ -2,7 +2,7 @@
//#include "fatfs.h"
#include "fatfs_drv.h"
#include "tos.h"
#include "tos_k.h"
#include <hal_spi_flash.h>
/* Defines ------------------------------------------------------------------*/

View File

@@ -31,7 +31,7 @@
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "tos.h"
#include "tos_k.h"
#include "tos_at.h"
#include "usart.h"
@@ -48,7 +48,7 @@ extern UART_HandleTypeDef huart2;
extern UART_HandleTypeDef huart3;
/******************************************************************************/
/* Cortex-M3 Processor Interruption and Exception Handlers */
/* Cortex-M3 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
@@ -187,7 +187,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
//HAL_SYSTICK_IRQHandler();

View File

@@ -8,7 +8,7 @@
#include "stm32f4xx_hal.h"
#include "usart.h"
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -21,7 +21,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f4xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -64,7 +64,7 @@ extern UART_HandleTypeDef huart2;
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M4 Processor Interruption and Exception Handlers */
/* Cortex-M4 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -187,11 +187,11 @@ void SysTick_Handler(void)
/* USER CODE END SysTick_IRQn 0 */
HAL_IncTick();
if(tos_knl_is_running())
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_knl_irq_leave();
tos_knl_irq_enter();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -10,7 +10,7 @@
#include "gpio.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

View File

@@ -21,11 +21,11 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f7xx_it.h"
#include "tos.h"
#include "tos_k.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN TD */
@@ -33,7 +33,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -63,7 +63,7 @@ extern UART_HandleTypeDef huart1;
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M7 Processor Interruption and Exception Handlers */
/* Cortex-M7 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -189,7 +189,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -21,12 +21,12 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f7xx_it.h"
#include "tos.h"
#include "tos_k.h"
#include "lvgl/src/lv_hal/lv_hal_tick.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN TD */
@@ -34,7 +34,7 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -64,7 +64,7 @@ extern UART_HandleTypeDef huart1;
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M7 Processor Interruption and Exception Handlers */
/* Cortex-M7 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
@@ -191,7 +191,7 @@ void SysTick_Handler(void)
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_tick_handler();
tos_knl_irq_leave();
}
/* USER CODE BEGIN SysTick_IRQn 1 */

View File

@@ -1,4 +1,4 @@
#include "tos.h"
#include "tos_k.h"
// systick handler
void eclic_mtip_handler() {

View File

@@ -1,5 +1,5 @@
#include "mcu_init.h"
#include "tos.h"
#include "tos_k.h"
#include "lcd.h"
#define TASK_SIZE 1024

View File

@@ -21,7 +21,7 @@
#include <msp430.h>
#include <driverlib.h>
#include <stdint.h>
#include "tos.h"
#include "tos_k.h"
#define TASK1_STK_SIZE 320 // more than 300 for stb printf
#define TASK2_STK_SIZE 320 // more than 300 for stb printf
@@ -41,13 +41,13 @@ void task2_entry(void *arg);
/* EUSCI-UART-UCA1 115200 @ 8M */
EUSCI_A_UART_initParam uart_config =
EUSCI_A_UART_initParam uart_config =
{
EUSCI_A_UART_CLOCKSOURCE_SMCLK, // SMCLK Clock Source
4, // BRDIV
5, // UCxBRF
85, // UCxBRS
4, // BRDIV
5, // UCxBRF
85, // UCxBRS
EUSCI_A_UART_NO_PARITY, // No Parity
EUSCI_A_UART_LSB_FIRST, // MSB First
@@ -64,11 +64,11 @@ EUSCI_A_UART_initParam uart_config =
*/
void systick_handler(void)
{
if(tos_knl_is_running())
if(tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_knl_irq_leave();
tos_knl_irq_enter();
tos_tick_handler();
tos_knl_irq_leave();
}
}
@@ -105,7 +105,7 @@ void board_init(void)
/* Disable the GPIO power-on default high-impedance mode. */
PMM_unlockLPM5();
/* Set P1.0(LED1) to output direction */
GPIO_setAsOutputPin(GPIO_PORT_P1,GPIO_PIN0);
@@ -117,7 +117,7 @@ void board_init(void)
GPIO_setAsOutputPin( GPIO_PORT_P3, GPIO_PIN4 );
GPIO_setAsPeripheralModuleFunctionInputPin( GPIO_PORT_P3, GPIO_PIN5, GPIO_PRIMARY_MODULE_FUNCTION );
GPIO_setAsPeripheralModuleFunctionOutputPin( GPIO_PORT_P3, GPIO_PIN4, GPIO_PRIMARY_MODULE_FUNCTION );
EUSCI_A_UART_init(EUSCI_A1_BASE, &uart_config);
EUSCI_A_UART_enable(EUSCI_A1_BASE);
//EUSCI_A_UART_enableInterrupt(EUSCI_A1_BASE, EUSCI_A_UART_RECEIVE_INTERRUPT);
@@ -130,7 +130,7 @@ void board_init(void)
* @return ch
*/
int putchar(int ch)
{
{
EUSCI_A_UART_transmitData(EUSCI_A1_BASE, ch);
return (ch);
@@ -145,10 +145,10 @@ int putchar(int ch)
void task1_entry(void *arg)
{
int count = 1;
while (1)
while (1)
{
printf("###This is task1, %d\r\n", count++);
GPIO_toggleOutputOnPin(GPIO_PORT_P1,GPIO_PIN0);
tos_task_delay(tos_millisec2tick(2000));
@@ -164,12 +164,12 @@ void task1_entry(void *arg)
void task2_entry(void *arg)
{
int count = 1;
while (1)
{
while (1)
{
printf("***This is task2, %d\r\n", count++);
GPIO_toggleOutputOnPin(GPIO_PORT_P9,GPIO_PIN7);
tos_task_delay(tos_millisec2tick(1000));
}
}
@@ -177,11 +177,11 @@ void task2_entry(void *arg)
int main(void)
{
k_err_t err;
board_init();
printf("Welcome to TencentOS tiny\r\n");
tos_knl_init();
err = tos_task_create(&task1, "task1", task1_entry,
@@ -189,7 +189,7 @@ int main(void)
task1_stack, sizeof(task1_stack),0);
err = tos_task_create(&task2, "task2", task2_entry,
K_NULL, TASK2_PRIO,
task2_stack, sizeof(task2_stack),0);
task2_stack, sizeof(task2_stack),0);
if( err == K_ERR_NONE )
{
err = tos_knl_start();
@@ -197,7 +197,7 @@ int main(void)
else
{
printf("TencentOS tiny fail to creat tasks \r\n");
while(1);
}
}

View File

@@ -12,7 +12,7 @@
#include "i2c.h"
#include "bh1750.h"
#include "DHT11_BUS.h"
#include "tos.h"
#include "tos_k.h"
void board_init(void);
void SystemClock_Config(void);

Some files were not shown because too many files have changed in this diff Show More