You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
5.4 KiB

C51 COMPILER V9.54 TTSS_TIME_STC 09/06/2024 14:31:12 PAGE 1
C51 COMPILER V9.54, COMPILATION OF MODULE TTSS_TIME_STC
OBJECT MODULE PLACED IN ..\out\TTSS_time_stc.obj
COMPILER INVOKED BY: E:\KeilC51\C51\BIN\C51.EXE ..\source\ctask\TTSS_time_stc.c LARGE OMF2 OPTIMIZE(0,SIZE) BROWSE ORDER
- NOINTPROMOTE INCDIR(..\source\bsp;..\source\msp;..\source\app;..\source\clib;..\source\cpu;..\source\ctask;..\source\tp
-c;..\source\asp;..\source\debug;..\source\msp\uart;..\source\msp\simiic;..\source\bsp\oled;..\source\bsp\TTSSbsp) DEBUG
-PRINT(..\out\TTSS_time_stc.lst) TABS(2) OBJECT(..\out\TTSS_time_stc.obj)
line level source
1 #include "ttss_time_stc.h"
*** WARNING C320 IN LINE 51 OF ..\source\bsp\TTSSbsp\bsp_config.h: "MainFre_22M"
2 #define D_TIMER_COUNT(t,clk,timeInUs) (U16)(65536 - (clk) / 1000 * timeInUs / 1000 / t)
3
4 /*************初始化定时器0由 stc-isp v6.86L定时器计算器生成******************/
5
6
7 #if(MainFre_5M == D_sys_MainFre)
#elif(MainFre_22M == D_sys_MainFre)
11 void L0_timer0_Init(void)//void Timer0Init(void) //12500微秒@22.1184MHz
12 {
13 1 AUXR &= 0x7F; //定时器时钟12T模式
14 1 TMOD &= 0xF0; //设置定时器模式
15 1 TL0 = 0x00; //设置定时初始值
16 1 TH0 = 0xA6; //设置定时初始值
17 1 TF0 = 0; //清除TF0标志
18 1 TR0 = 1; //定时器0开始计时
19 1 }
20
21
22 #elif(MainFre_27M == D_sys_MainFre)
#elif(MainFre_44M == D_sys_MainFre)
void L0_timer0_Init(void)/////void Timer0Init(void) //12.5m秒@44.0800MHz
{
AUXR &= 0x7F; //定时器时钟12T模式
TMOD &= 0xF0; //设置定时器模式
TL0 = 0xA3; //设置定时初始值
TH0 = 0x4C; //设置定时初始值
TF0 = 0; //清除TF0标志
TR0 = 1; //定时器0开始计时
}
void L0_timer4_Init(void)/////void Timer4_Init(void) //100微秒@44.2368MHz
{
T4T3M |= 0x20; //定时器时钟1T模式
T4L = 0xB8; //设置定时初始值
T4H = 0xEE; //设置定时初始值
T4T3M |= 0x80; //定时器4开始计时
}
#else ///MainFre_11M
////#warn
void L0_timer0_Init(void)
{
U16 val = D_TIMER_COUNT(12,D_sys_MainFre,D_sys_Jiffies * 1000);
AUXR &= 0x7F; //定时器时钟12T模式
TMOD &= 0xF0; //设置定时器模式
C51 COMPILER V9.54 TTSS_TIME_STC 09/06/2024 14:31:12 PAGE 2
//TL0 = 0x00; //设置定时初值
//TH0 = 0x4C; //设置定时初值
TL0 = val; //设置定时初值
TH0 = val >> 8; //设置定时初值
TF0 = 0; //清除TF0标志
TR0 = 1; //定时器0开始计时
}
#endif//D_sys_MainFre)
61 #if 0
/// 65535*65535 /3600/24/365=139nian/s=1.39nian/10ms
///相当于1.39年后t_10ms 溢出,对于电池供电的系统而言 完全可以满足
// 4,294,836,225 = 65535*65535 ;3600*24*60*60 = 31,536,000秒/年
s_nos_tick.t_10ms ++;//D_led_D1_REV(); 20160522 验证
#endif
67
68 //10---87 10s
69 /********************** Timer0中断函数************************/
70 /// 和 L0_timer0_Init 关联,需要配置 bsp_config.h中的 D_sys_MainFre
71 /// 默认10ms 作为TTSS系统的定时引擎
72 void timer0_isrHandle (void) D_SERVE_TIMER0
73 {//
74 1 NOP(); NOP(); NOP();
75 1 TF0 = 0;
76 1 L1_task_tick_callback(); ///系统中的1sflag 和以10ms为颗粒的延时使用 为tdelay服务
77 1 /// BITN_1(DR_who_wakeup, DRB_who_wakeup_timer0);
78 1 NOP(); NOP(); NOP();
79 1 }
80
81 void L1_timer0_Init(void)
82 {
83 1 ///step1:时钟
84 1 ///step2:模块使能
85 1 ///step3:启动
86 1 ///step4:模块中断使能
87 1 ///step5:全局中断使能
88 1 L0_timer0_Init();
89 1 ET0 = 1;///经常因为替换L0_timer0_Init(由stcisp例程生成) 改指令漏掉
90 1 }
91
92
93
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 93 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
EDATA SIZE = ---- ----
HDATA SIZE = ---- ----
XDATA CONST SIZE = ---- ----
FAR CONST SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 1 WARNING(S), 0 ERROR(S)