70 lines
3.3 KiB
Plaintext
70 lines
3.3 KiB
Plaintext
C51 COMPILER V9.01 START_INIT 12/15/2025 20:45:04 PAGE 1
|
||
|
||
|
||
C51 COMPILER V9.01, COMPILATION OF MODULE START_INIT
|
||
OBJECT MODULE PLACED IN .\Objects\Start_Init.obj
|
||
COMPILER INVOKED BY: D:\Keil_v5\C51\BIN\C51.EXE Start_Init.c OPTIMIZE(8,SPEED) BROWSE DEBUG OBJECTEXTEND PRINT(.\Listing
|
||
-s\Start_Init.lst) OBJECT(.\Objects\Start_Init.obj)
|
||
|
||
line level source
|
||
|
||
1 #include "STC8xxxx.h"
|
||
2 #include "Start_Init.h"
|
||
3 #include "string.h"
|
||
4 #include "UART_Set.h"
|
||
5 #include "timer.h"
|
||
6 #include "pwm_control.h"
|
||
7
|
||
8 void Start_Init(void)
|
||
9 {
|
||
10 1 u8 i;
|
||
11 1 memset(&g_Usart,0,sizeof(g_Usart));
|
||
12 1 memset(&s_recv, 0, sizeof(s_recv));
|
||
13 1 memset(&g_answer,0,sizeof(g_answer));
|
||
14 1 g_Usart.lastsn=0xFF;
|
||
15 1 s_recv.B_min = 0;
|
||
16 1 s_recv.B_max = 100;
|
||
17 1 s_recv.global_brightness = 100;
|
||
18 1
|
||
19 1 for(i=0;i<12;i++)
|
||
20 1 {
|
||
21 2 s_recv.pwm_step[i] = 1;
|
||
22 2 s_recv.key_status[i] = 1;
|
||
23 2 s_recv.gradual_time[i] = 300;
|
||
24 2 }
|
||
25 1 }
|
||
26
|
||
27 //定时器2的1ms定时
|
||
28 void Timer2_Init_1ms(void)
|
||
29 {
|
||
30 1 TIM_InitTypeDef TIM_InitStructure; //结构定义
|
||
31 1 TIM_InitStructure.TIM_Mode = TIM_16BitAutoReload; //指定工作模式, TIM_16BitAutoReload,TIM_16Bit,TI
|
||
-M_8BitAutoReload,TIM_16BitAutoReloadNoMask
|
||
32 1 TIM_InitStructure.TIM_Priority = Priority_3; //指定中断优先级(低到高) Priority_0,Priority_1,Priority
|
||
-_2,Priority_3
|
||
33 1 TIM_InitStructure.TIM_Interrupt = ENABLE; //中断是否允许, ENABLE或DISABLE. (注意: Timer2固定为16位<36>
|
||
-远<>刈<EFBFBD>, 中断固定为低优先级)
|
||
34 1 TIM_InitStructure.TIM_ClkSource = TIM_CLOCK_12T; //指定时钟源, TIM_CLOCK_1T,TIM_CLOCK_12T,TIM_CLOCK_
|
||
-Ext
|
||
35 1 TIM_InitStructure.TIM_ClkOut = DISABLE; //是否输出高速脉冲, ENABLE或DISABLE
|
||
36 1 TIM_InitStructure.TIM_Value = 63693UL; //初值,定时为1ms
|
||
37 1 TIM_InitStructure.TIM_Run = ENABLE; //是否初始化后启动定时器, ENABLE或DISABLE
|
||
38 1 Timer_Inilize(Timer2,&TIM_InitStructure); //初始化Timer2 Timer0,Timer1,Timer2,Timer3,Timer4
|
||
39 1 }
|
||
|
||
|
||
MODULE INFORMATION: STATIC OVERLAYABLE
|
||
CODE SIZE = 168 ----
|
||
CONSTANT SIZE = ---- ----
|
||
XDATA SIZE = ---- ----
|
||
PDATA SIZE = ---- ----
|
||
DATA SIZE = ---- 8
|
||
IDATA SIZE = ---- ----
|
||
BIT SIZE = ---- ----
|
||
END OF MODULE INFORMATION.
|
||
|
||
C51 COMPILER V9.01 START_INIT 12/15/2025 20:45:04 PAGE 2
|
||
|
||
|
||
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
|