mirror of
https://github.com/armink/FreeModbus_Slave-Master-RTT-STM32.git
synced 2025-01-27 00:47:11 +08:00
f16856e34c
2、【修改】IAR、Keil工程中启动文件,及部分CM3相关的文件,解决之前工程配置遗留下来的问题 3、【增加】RTT的CPU利用率更新至Modbus保持寄存器的功能 Signed-off-by: armink <armink.ztl@gmail.com>
45 lines
1.4 KiB
C
45 lines
1.4 KiB
C
/*********************************************************************************************************/
|
|
// Filename : delay_config.h
|
|
// Version : V1.00
|
|
// Programmer(s) : Liuqiuhu
|
|
// funcion : This file is used to configure the delay time
|
|
/*********************************************************************************************************/
|
|
#ifndef __DELAY_CONF_H__
|
|
#define __DELAY_CONF_H__
|
|
|
|
#include"rtconfig.h"
|
|
|
|
#if RT_TICK_PER_SECOND == 1
|
|
#define DELAY_1S (RT_TICK_PER_SECOND)
|
|
#define DELAY_S(X) (X*DELAY_1S)
|
|
|
|
#elif RT_TICK_PER_SECOND == 10
|
|
#define DELAY_100MS(X) (X)
|
|
#define DELAY_S(X) (X*10)
|
|
|
|
#elif RT_TICK_PER_SECOND == 100
|
|
#define DELAY_10MS(X) (X)
|
|
#define DELAY_100MS(X) (X*10)
|
|
#define DELAY_S(X) (X*100)
|
|
|
|
#elif (RT_TICK_PER_SECOND == 1000)
|
|
|
|
#define DELAY_1MS (RT_TICK_PER_SECOND/1000)
|
|
#define DELAY_MS(X) (X*DELAY_1MS)
|
|
#define DELAY_S(X) (X*1000*DELAY_1MS)
|
|
|
|
#elif (RT_TICK_PER_SECOND == 10000)||(RT_TICK_PER_SECOND == 100000)||(RT_TICK_PER_SECOND == 100000)
|
|
#define DELAY_100US(X) (X*RT_TICK_PER_SECOND/10000)
|
|
#define DELAY_1MS (RT_TICK_PER_SECOND/1000)
|
|
#define DELAY_MS(X) (X*DELAY_1MS)
|
|
#define DELAY_S(X) (X*1000*DELAY_1MS)
|
|
|
|
#endif
|
|
|
|
#define DELAY_SYS_RUN_LED DELAY_MS(500) //系统指示灯延时500ms
|
|
#define DELAY_SYS_SLEEP_LED DELAY_MS(1000) //系统指示灯延时1s
|
|
#define DELAY_MB_SLAVER_POLL DELAY_MS(10) //Modbus从机轮训时间
|
|
|
|
#endif
|
|
|