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.
|
|
|
|
C51 COMPILER V9.56.0.0 PWM 04/08/2022 03:07:52 PAGE 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
C51 COMPILER V9.56.0.0, COMPILATION OF MODULE PWM
|
|
|
|
|
OBJECT MODULE PLACED IN pwm.OBJ
|
|
|
|
|
COMPILER INVOKED BY: D:\Keil_v5\C51\BIN\C51.EXE pwm.c OPTIMIZE(8,SPEED) BROWSE DEBUG OBJECTEXTEND TABS(2)
|
|
|
|
|
|
|
|
|
|
line level source
|
|
|
|
|
|
|
|
|
|
1 #include "pwm.h"
|
|
|
|
|
2
|
|
|
|
|
3 unsigned char pwm_val_right =0;
|
|
|
|
|
4 unsigned char push_val_right=0;
|
|
|
|
|
5
|
|
|
|
|
6 unsigned char pwm_value=0;
|
|
|
|
|
7
|
|
|
|
|
8 extern uint model;
|
|
|
|
|
9
|
|
|
|
|
10 bit Right_moto_stop = 0;
|
|
|
|
|
11
|
|
|
|
|
12 void delay(unsigned int k)
|
|
|
|
|
13 {
|
|
|
|
|
14 1 unsigned int x,y;
|
|
|
|
|
15 1 for(x=0;x<k;x++)
|
|
|
|
|
16 1 for(y=0;y<2000;y++);
|
|
|
|
|
17 1 }
|
|
|
|
|
18
|
|
|
|
|
19 void run(void)
|
|
|
|
|
20 {
|
|
|
|
|
21 1 if(model == 0) pwm_value = 0;
|
|
|
|
|
22 1 else if(model == 1) pwm_value = 2;
|
|
|
|
|
23 1 else if(model == 2) pwm_value = 5;
|
|
|
|
|
24 1 else pwm_value = 10;
|
|
|
|
|
25 1 push_val_right=pwm_value;
|
|
|
|
|
26 1 Right_moto_back;
|
|
|
|
|
27 1 }
|
|
|
|
|
28
|
|
|
|
|
29 void pwm_out_right_moto(void)
|
|
|
|
|
30 {
|
|
|
|
|
31 1 pwm_val_right++;
|
|
|
|
|
32 1 if(~Right_moto_stop){
|
|
|
|
|
33 2 if(pwm_val_right <= push_val_right)
|
|
|
|
|
34 2 {
|
|
|
|
|
35 3 Right_moto_pwm=1;
|
|
|
|
|
36 3 }
|
|
|
|
|
37 2 else
|
|
|
|
|
38 2 {
|
|
|
|
|
39 3 Right_moto_pwm=0;
|
|
|
|
|
40 3 }
|
|
|
|
|
41 2 if(pwm_val_right>=20) pwm_val_right=0;
|
|
|
|
|
42 2 }
|
|
|
|
|
43 1 else{
|
|
|
|
|
44 2 Right_moto_pwm=0;
|
|
|
|
|
45 2 }
|
|
|
|
|
46 1 }
|
|
|
|
|
47
|
|
|
|
|
48
|
|
|
|
|
49
|
|
|
|
|
50
|
|
|
|
|
51
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MODULE INFORMATION: STATIC OVERLAYABLE
|
|
|
|
|
CODE SIZE = 112 ----
|
|
|
|
|
C51 COMPILER V9.56.0.0 PWM 04/08/2022 03:07:52 PAGE 2
|
|
|
|
|
|
|
|
|
|
CONSTANT SIZE = ---- ----
|
|
|
|
|
XDATA SIZE = ---- ----
|
|
|
|
|
PDATA SIZE = ---- ----
|
|
|
|
|
DATA SIZE = 3 ----
|
|
|
|
|
IDATA SIZE = ---- ----
|
|
|
|
|
BIT SIZE = 1 ----
|
|
|
|
|
END OF MODULE INFORMATION.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
|