両輪の PWM 指定による回転を確認
@@ -1,59 +0,0 @@ | ||
1 | -/*! | |
2 | - \file | |
3 | - \brief エンコーダ制御 | |
4 | - | |
5 | - \author Satofumi KAMIMURA | |
6 | - | |
7 | - $Id$ | |
8 | -*/ | |
9 | - | |
10 | -#include "encoder_control.h" | |
11 | - | |
12 | - | |
13 | -static void encoder_initialize_device(int device_id) | |
14 | -{ | |
15 | - if (device_id == 0) { | |
16 | - // !!! | |
17 | - } else if (device_id == 1) { | |
18 | - // !!! | |
19 | - } | |
20 | -} | |
21 | - | |
22 | - | |
23 | -static unsigned short encoder_count(int device_id) | |
24 | -{ | |
25 | - if (device_id == 0) { | |
26 | - // !!! | |
27 | - return -1; | |
28 | - | |
29 | - } else if (device_id == 1) { | |
30 | - // !!! | |
31 | - return -1; | |
32 | - } | |
33 | - | |
34 | - return -1; | |
35 | -} | |
36 | - | |
37 | - | |
38 | -void encoder_initialize(encoder_t *encoder, int device_id) | |
39 | -{ | |
40 | - encoder_initialize_device(device_id); | |
41 | - | |
42 | - encoder->device_id = device_id; | |
43 | - encoder->previous_count = encoder_count(device_id); | |
44 | -} | |
45 | - | |
46 | - | |
47 | -void encoder_update(encoder_t *encoder) | |
48 | -{ | |
49 | - unsigned short current_count = encoder_count(encoder->device_id); | |
50 | - | |
51 | - encoder->difference = current_count - encoder->previous_count; | |
52 | - encoder->previous_count = current_count; | |
53 | -} | |
54 | - | |
55 | - | |
56 | -unsigned short encoder_difference(encoder_t *encoder) | |
57 | -{ | |
58 | - return encoder->difference; | |
59 | -} |
@@ -1,44 +0,0 @@ | ||
1 | -#ifndef QRK_ENCODER_CONTROL_H | |
2 | -#define QRK_ENCODER_CONTROL_H | |
3 | - | |
4 | -/*! | |
5 | - \file | |
6 | - \brief エンコーダ制御 | |
7 | - | |
8 | - \author Satofumi KAMIMURA | |
9 | - | |
10 | - $Id$ | |
11 | -*/ | |
12 | - | |
13 | - | |
14 | -#include "encoder_t.h" | |
15 | - | |
16 | - | |
17 | -//! 初期化 | |
18 | -extern void encoder_initialize(encoder_t *encoder, int device_id); | |
19 | - | |
20 | -//! エンコーダ値の更新 | |
21 | -extern void encoder_update(encoder_t *encoder); | |
22 | - | |
23 | -//! エンコーダ変位の取得 | |
24 | -extern unsigned short encoder_difference(encoder_t *encoder); | |
25 | - | |
26 | -#endif /* !QRK_ENCODER_CONTROL_H */ | |
27 | - | |
28 | - | |
29 | -/*! | |
30 | - \page encoder_control_h_page エンコーダ制御 | |
31 | - | |
32 | - エンコーダの値を定期的に読み取り、前回に読み出した値との差を取ることでエンコーダの変位量を計算する。 \n | |
33 | - エンコーダが 16 [bit] 幅の場合、エンコーダ変位量の差分は、以下のコードで計算できる。 | |
34 | - | |
35 | - \code | |
36 | - // unsigned short current_counter; // 今回読み出したのエンコーダ値 | |
37 | - // unsigned short previous_counter; // 前回読み出したエンコーダ値 | |
38 | - | |
39 | - short diff = current_counter - previous_counter; // エンコーダ変位 | |
40 | - \endcode | |
41 | - \n | |
42 | - | |
43 | - エンコーダの値を定期的に読み出すには、優先度を高めに設定した割り込みを用いること。 | |
44 | -*/ |
@@ -0,0 +1,62 @@ | ||
1 | +/*! | |
2 | + \file | |
3 | + \brief エンコーダ制御 | |
4 | + | |
5 | + \author Satofumi KAMIMURA | |
6 | + | |
7 | + $Id$ | |
8 | +*/ | |
9 | + | |
10 | +#include "encoder_reader.h" | |
11 | +#include "mtu2_initialize.h" | |
12 | + | |
13 | + | |
14 | +static void encoder_initialize_device(int device_id) | |
15 | +{ | |
16 | + mtu2_initialize(); | |
17 | + | |
18 | + if (device_id == 0) { | |
19 | + // !!! | |
20 | + } else if (device_id == 1) { | |
21 | + // !!! | |
22 | + } | |
23 | +} | |
24 | + | |
25 | + | |
26 | +static unsigned short encoder_count(int device_id) | |
27 | +{ | |
28 | + if (device_id == 0) { | |
29 | + // !!! | |
30 | + return -1; | |
31 | + | |
32 | + } else if (device_id == 1) { | |
33 | + // !!! | |
34 | + return -1; | |
35 | + } | |
36 | + | |
37 | + return -1; | |
38 | +} | |
39 | + | |
40 | + | |
41 | +void encoder_initialize(encoder_t *encoder, int device_id) | |
42 | +{ | |
43 | + encoder_initialize_device(device_id); | |
44 | + | |
45 | + encoder->device_id = device_id; | |
46 | + encoder->previous_count = encoder_count(device_id); | |
47 | +} | |
48 | + | |
49 | + | |
50 | +void encoder_update(encoder_t *encoder) | |
51 | +{ | |
52 | + unsigned short current_count = encoder_count(encoder->device_id); | |
53 | + | |
54 | + encoder->difference = current_count - encoder->previous_count; | |
55 | + encoder->previous_count = current_count; | |
56 | +} | |
57 | + | |
58 | + | |
59 | +unsigned short encoder_difference(encoder_t *encoder) | |
60 | +{ | |
61 | + return encoder->difference; | |
62 | +} |
@@ -0,0 +1,44 @@ | ||
1 | +#ifndef QRK_ENCODER_CONTROL_H | |
2 | +#define QRK_ENCODER_CONTROL_H | |
3 | + | |
4 | +/*! | |
5 | + \file | |
6 | + \brief エンコーダ制御 | |
7 | + | |
8 | + \author Satofumi KAMIMURA | |
9 | + | |
10 | + $Id$ | |
11 | +*/ | |
12 | + | |
13 | + | |
14 | +#include "encoder_t.h" | |
15 | + | |
16 | + | |
17 | +//! 初期化 | |
18 | +extern void encoder_initialize(encoder_t *encoder, int device_id); | |
19 | + | |
20 | +//! エンコーダ値の更新 | |
21 | +extern void encoder_update(encoder_t *encoder); | |
22 | + | |
23 | +//! エンコーダ変位の取得 | |
24 | +extern unsigned short encoder_difference(encoder_t *encoder); | |
25 | + | |
26 | +#endif /* !QRK_ENCODER_CONTROL_H */ | |
27 | + | |
28 | + | |
29 | +/*! | |
30 | + \page encoder_control_h_page エンコーダ制御 | |
31 | + | |
32 | + エンコーダの値を定期的に読み取り、前回に読み出した値との差を取ることでエンコーダの変位量を計算する。 \n | |
33 | + エンコーダが 16 [bit] 幅の場合、エンコーダ変位量の差分は、以下のコードで計算できる。 | |
34 | + | |
35 | + \code | |
36 | + // unsigned short current_counter; // 今回読み出したのエンコーダ値 | |
37 | + // unsigned short previous_counter; // 前回読み出したエンコーダ値 | |
38 | + | |
39 | + short diff = current_counter - previous_counter; // エンコーダ変位 | |
40 | + \endcode | |
41 | + \n | |
42 | + | |
43 | + エンコーダの値を定期的に読み出すには、優先度を高めに設定した割り込みを用いること。 | |
44 | +*/ |
@@ -0,0 +1,27 @@ | ||
1 | +/*! | |
2 | + \file | |
3 | + \brief MTU2 モジュールのスタンバイ解除 | |
4 | + | |
5 | + \author Satofumi KAMIMURA | |
6 | + | |
7 | + $Id$ | |
8 | +*/ | |
9 | + | |
10 | +#include "mtu2_initialize.h" | |
11 | +#include <stdbool.h> | |
12 | +#include <7125S.H> | |
13 | + | |
14 | + | |
15 | +void mtu2_initialize(void) | |
16 | +{ | |
17 | + static bool initialized = false; | |
18 | + | |
19 | + if (initialized) { | |
20 | + return; | |
21 | + } | |
22 | + | |
23 | + // スタンバイ解除 | |
24 | + STB.CR4.BYTE &= ~0x40; | |
25 | + | |
26 | + initialized = true; | |
27 | +} |
@@ -0,0 +1,16 @@ | ||
1 | +#ifndef MTU2_INITIALIZE_H | |
2 | +#define MTU2_INITIALIZE_H | |
3 | + | |
4 | +/*! | |
5 | + \file | |
6 | + \brief MTU2 モジュールのスタンバイ解除 | |
7 | + | |
8 | + \author Satofumi KAMIMURA | |
9 | + | |
10 | + $Id$ | |
11 | +*/ | |
12 | + | |
13 | + | |
14 | +extern void mtu2_initialize(void); | |
15 | + | |
16 | +#endif /* !MTU2_INITIALIZE_H */ |
@@ -27,7 +27,7 @@ | ||
27 | 27 | |
28 | 28 | .PHONY : all clean html upload |
29 | 29 | ###################################################################### |
30 | -run_drive.mot : run_drive.o initialize_state.o control_state.o pause_state.o clock_initialize.o imask_control.o communication_handler.o protocol_handler.o sci_control.o emergency_io_control.o timer_control.o path_handler.o position_handler.o velocity_handler.o body_handler.o wheel_handler.o motor_velocity.o motor_pwm.o encoder_control.o odometry_calculate.o | |
30 | +run_drive.mot : run_drive.o initialize_state.o control_state.o pause_state.o clock_initialize.o imask_control.o communication_handler.o protocol_handler.o sci_control.o emergency_io_control.o timer_control.o path_handler.o position_handler.o velocity_handler.o body_handler.o wheel_handler.o motor_velocity.o motor_pwm.o encoder_reader.o odometry_calculate.o mtu2_initialize.o | |
31 | 31 | |
32 | 32 | # DO NOT DELETE |
33 | 33 |
@@ -34,7 +34,7 @@ | ||
34 | 34 | body_handler.o: wheel_t.h encoder_t.h |
35 | 35 | control_state.o: run_t.h controller_config.h odometry_t.h path_t.h wheel_t.h |
36 | 36 | control_state.o: encoder_t.h |
37 | -encoder_control.o: encoder_t.h | |
37 | +encoder_reader.o: encoder_t.h | |
38 | 38 | initialize_state.o: run_t.h controller_config.h odometry_t.h path_t.h |
39 | 39 | initialize_state.o: wheel_t.h encoder_t.h |
40 | 40 | odometry_calculate.o: odometry_t.h |
@@ -54,9 +54,9 @@ | ||
54 | 54 | control_state.o: control_state.h run_t.h controller_config.h odometry_t.h |
55 | 55 | control_state.o: path_t.h wheel_t.h encoder_t.h pause_state.h |
56 | 56 | control_state.o: emergency_io_control.h timer_control.h protocol_handler.h |
57 | -control_state.o: encoder_control.h odometry_calculate.h path_handler.h | |
57 | +control_state.o: encoder_reader.h odometry_calculate.h path_handler.h | |
58 | 58 | emergency_io_control.o: emergency_io_control.h |
59 | -encoder_control.o: encoder_control.h encoder_t.h | |
59 | +encoder_reader.o: encoder_reader.h encoder_t.h mtu2_initialize.h | |
60 | 60 | imask_control.o: imask_control.h |
61 | 61 | initialize_state.o: initialize_state.h run_t.h controller_config.h |
62 | 62 | initialize_state.o: odometry_t.h path_t.h wheel_t.h encoder_t.h |
@@ -64,8 +64,9 @@ | ||
64 | 64 | initialize_state.o: emergency_io_control.h odometry_calculate.h |
65 | 65 | initialize_state.o: path_handler.h wheel_handler.h protocol_handler.h |
66 | 66 | initialize_state.o: interrupt_priority.h |
67 | -motor_pwm.o: motor_pwm.h | |
67 | +motor_pwm.o: motor_pwm.h mtu2_initialize.h | |
68 | 68 | motor_velocity.o: motor_velocity.h |
69 | +mtu2_initialize.o: mtu2_initialize.h | |
69 | 70 | odometry_calculate.o: odometry_calculate.h odometry_t.h |
70 | 71 | path_handler.o: path_t.h position_handler.h |
71 | 72 | pause_state.o: pause_state.h run_t.h controller_config.h odometry_t.h |
@@ -12,7 +12,7 @@ | ||
12 | 12 | #include "emergency_io_control.h" |
13 | 13 | #include "timer_control.h" |
14 | 14 | #include "protocol_handler.h" |
15 | -#include "encoder_control.h" | |
15 | +#include "encoder_reader.h" | |
16 | 16 | #include "odometry_calculate.h" |
17 | 17 | #include "path_handler.h" |
18 | 18 | #include <stddef.h> |
@@ -36,20 +36,23 @@ | ||
36 | 36 | */ |
37 | 37 | |
38 | 38 | #include "motor_pwm.h" |
39 | +#include "mtu2_initialize.h" | |
39 | 40 | #include <7125S.H> |
40 | 41 | |
41 | 42 | typedef enum { |
42 | - Lo = 0, | |
43 | - Hi = 1, | |
43 | + LO = 0, | |
44 | + HI = 1, | |
44 | 45 | } io_state_t; |
45 | 46 | |
46 | 47 | |
47 | 48 | static void set_pe8(io_state_t state) |
48 | 49 | { |
49 | - if (state == Hi) { | |
50 | - // !!! | |
50 | + PFC.PECRL3.WORD &= ~0x0007; | |
51 | + PFC.PEIORL.WORD |= 0x0100; | |
52 | + if (state == HI) { | |
53 | + PE.DRL.WORD |= 0x0100; | |
51 | 54 | } else { |
52 | - // !!! | |
55 | + PE.DRL.WORD &= ~0x0100; | |
53 | 56 | } |
54 | 57 | } |
55 | 58 |
@@ -56,13 +59,12 @@ | ||
56 | 59 | |
57 | 60 | void set_pe10(io_state_t state) |
58 | 61 | { |
59 | - (void)state; | |
60 | - // !!! | |
61 | - | |
62 | - if (state == Hi) { | |
63 | - // !!! | |
62 | + PFC.PECRL3.WORD &= ~0x0700; | |
63 | + PFC.PEIORL.WORD |= 0x0400; | |
64 | + if (state == HI) { | |
65 | + PE.DRL.WORD |= 0x0400; | |
64 | 66 | } else { |
65 | - // !!! | |
67 | + PE.DRL.WORD &= ~0x0400; | |
66 | 68 | } |
67 | 69 | } |
68 | 70 |
@@ -69,27 +71,26 @@ | ||
69 | 71 | |
70 | 72 | static void set_pe8_pwm(unsigned char duty) |
71 | 73 | { |
72 | - (void)duty; | |
73 | - // !!! | |
74 | + PFC.PECRL3.WORD |= 0x0001; | |
75 | + MTU23.TGRB = duty; | |
74 | 76 | } |
75 | 77 | |
76 | 78 | |
77 | 79 | static void set_pe10_pwm(unsigned char duty) |
78 | 80 | { |
79 | - (void)duty; | |
80 | - // !!! | |
81 | + PFC.PECRL3.WORD |= 0x0100; | |
82 | + MTU23.TGRD = duty; | |
81 | 83 | } |
82 | 84 | |
83 | 85 | |
84 | 86 | static void set_pe12(io_state_t state) |
85 | 87 | { |
86 | - (void)state; | |
87 | - // !!! | |
88 | - | |
89 | - if (state == Hi) { | |
90 | - // !!! | |
88 | + PFC.PECRL4.WORD &= ~0x0007; | |
89 | + PFC.PEIORL.WORD |= 0x1000; | |
90 | + if (state == HI) { | |
91 | + PE.DRL.WORD |= 0x1000; | |
91 | 92 | } else { |
92 | - // !!! | |
93 | + PE.DRL.WORD &= ~0x1000; | |
93 | 94 | } |
94 | 95 | } |
95 | 96 |
@@ -96,13 +97,12 @@ | ||
96 | 97 | |
97 | 98 | static void set_pe14(io_state_t state) |
98 | 99 | { |
99 | - (void)state; | |
100 | - // !!! | |
101 | - | |
102 | - if (state == Hi) { | |
103 | - // !!! | |
100 | + PFC.PECRL4.WORD &= ~0x0700; | |
101 | + PFC.PEIORL.WORD |= 0x4000; | |
102 | + if (state == HI) { | |
103 | + PE.DRL.WORD |= 0x4000; | |
104 | 104 | } else { |
105 | - // !!! | |
105 | + PE.DRL.WORD &= ~0x4000; | |
106 | 106 | } |
107 | 107 | } |
108 | 108 |
@@ -109,27 +109,28 @@ | ||
109 | 109 | |
110 | 110 | static void set_pe12_pwm(unsigned char duty) |
111 | 111 | { |
112 | - (void)duty; | |
113 | - // !!! | |
112 | + PFC.PECRL4.WORD |= 0x0001; | |
113 | + MTU24.TGRB = duty; | |
114 | 114 | } |
115 | 115 | |
116 | 116 | |
117 | 117 | static void set_pe14_pwm(unsigned char duty) |
118 | 118 | { |
119 | - (void)duty; | |
120 | - // !!! | |
119 | + PFC.PECRL4.WORD |= 0x0100; | |
120 | + MTU24.TGRD = duty; | |
121 | 121 | } |
122 | 122 | |
123 | 123 | |
124 | 124 | static void set_cw(int device_id, unsigned char duty) |
125 | 125 | { |
126 | + // PWM 出力が Lo のときに回転するので、指定された duty をここで反転させる | |
126 | 127 | if (device_id == 0) { |
127 | - set_pe10(Hi); | |
128 | - set_pe8_pwm(duty); | |
128 | + set_pe8(HI); | |
129 | + set_pe10_pwm(255 - duty); | |
129 | 130 | |
130 | 131 | } else if (device_id == 1) { |
131 | - set_pe14(Hi); | |
132 | - set_pe12_pwm(duty); | |
132 | + set_pe12(HI); | |
133 | + set_pe14_pwm(255 - duty); | |
133 | 134 | } |
134 | 135 | } |
135 | 136 |
@@ -136,15 +137,14 @@ | ||
136 | 137 | |
137 | 138 | static void set_ccw(int device_id, unsigned char duty) |
138 | 139 | { |
140 | + // PWM 出力が Lo のときに回転するので、指定された duty をここで反転させる | |
139 | 141 | if (device_id == 0) { |
140 | - // PE8: Hi, PE10: PWM | |
141 | - set_pe8(Hi); | |
142 | - set_pe10_pwm(duty); | |
142 | + set_pe10(HI); | |
143 | + set_pe8_pwm(255 - duty); | |
143 | 144 | |
144 | 145 | } else if (device_id == 1) { |
145 | - // PE12: Hi, PE14: PWM | |
146 | - set_pe12(Hi); | |
147 | - set_pe14_pwm(duty); | |
146 | + set_pe14(HI); | |
147 | + set_pe12_pwm(255 - duty); | |
148 | 148 | } |
149 | 149 | } |
150 | 150 |
@@ -151,6 +151,8 @@ | ||
151 | 151 | |
152 | 152 | void motor_pwm_initialize(int device_id) |
153 | 153 | { |
154 | + mtu2_initialize(); | |
155 | + | |
154 | 156 | if (device_id == 0) { |
155 | 157 | // PE8/TIOC3A, PI10/TIOC3C 側 |
156 | 158 |
@@ -174,12 +176,8 @@ | ||
174 | 176 | MTU23.TMDR.BYTE = 0x02; |
175 | 177 | |
176 | 178 | // TIOC3C(PE10), TIOC3A(PE8) 出力設定 |
177 | - PFC.PEIORL.WORD &= ~0x0f00; | |
178 | 179 | PFC.PEIORL.WORD |= 0x0500; |
179 | 180 | |
180 | - // 初期状態では、"正転 <-> ブレーキ" に設定し、duty 比をゼロにする | |
181 | - set_cw(device_id, 0); | |
182 | - | |
183 | 181 | // TCNT のスタート |
184 | 182 | MTU2.TSTR.BYTE |= 0x40; |
185 | 183 |
@@ -190,7 +188,7 @@ | ||
190 | 188 | MTU2.TSTR.BYTE &= ~0x80; |
191 | 189 | |
192 | 190 | // 出力設定 |
193 | - MTU2.TOER.BYTE |= 0xc0 | 0x12; | |
191 | + MTU2.TOER.BYTE |= 0x12; | |
194 | 192 | |
195 | 193 | // 周期を TGRA に設定 |
196 | 194 | MTU24.TCR.BYTE = 0x25; |
@@ -209,15 +207,14 @@ | ||
209 | 207 | MTU24.TMDR.BYTE = 0x02; |
210 | 208 | |
211 | 209 | // TIOC4C(PE14), TIOC4A(PE12) 出力設定 |
212 | - PFC.PEIORL.WORD &= ~0xf000; | |
213 | 210 | PFC.PEIORL.WORD |= 0x5000; |
214 | 211 | |
215 | - // 初期状態では、"正転 <-> ブレーキ" に設定し、duty 比をゼロにする | |
216 | - set_cw(device_id, 0); | |
217 | - | |
218 | 212 | // TCNT のスタート |
219 | 213 | MTU2.TSTR.BYTE |= 0x80; |
220 | 214 | } |
215 | + | |
216 | + // 初期状態では、"正転 <-> ブレーキ" に設定し、duty 比をゼロにする | |
217 | + set_cw(device_id, 0); | |
221 | 218 | } |
222 | 219 | |
223 | 220 |
@@ -1,5 +0,0 @@ | ||
1 | -int main(void) | |
2 | -{ | |
3 | - // !!! | |
4 | - return 0; | |
5 | -} |
@@ -1,16 +0,0 @@ | ||
1 | -/*! | |
2 | - \example モータの PWM 出力サンプル | |
3 | - | |
4 | - \author Satofumi KAMIMURA | |
5 | - | |
6 | - $Id$ | |
7 | -*/ | |
8 | - | |
9 | -#include "motor_pwm.h" | |
10 | - | |
11 | - | |
12 | -int main(void) | |
13 | -{ | |
14 | - // !!! | |
15 | - return 0; | |
16 | -} |
@@ -0,0 +1,16 @@ | ||
1 | +/*! | |
2 | + \example motor_velocity_out.c モータの速度制御サンプル | |
3 | + | |
4 | + \author Satofumi KAMIMURA | |
5 | + | |
6 | + $Id$ | |
7 | +*/ | |
8 | + | |
9 | +#include "motor_velocity.h" | |
10 | + | |
11 | + | |
12 | +int main(void) | |
13 | +{ | |
14 | + // !!! | |
15 | + return 0; | |
16 | +} |
@@ -0,0 +1,30 @@ | ||
1 | +/*! | |
2 | + \example motor_pwm_out.c モータの PWM 出力サンプル | |
3 | + | |
4 | + \author Satofumi KAMIMURA | |
5 | + | |
6 | + $Id$ | |
7 | +*/ | |
8 | + | |
9 | +#include "clock_initialize.h" | |
10 | +#include "motor_pwm.h" | |
11 | + | |
12 | + | |
13 | +int main(void) | |
14 | +{ | |
15 | + enum { | |
16 | + DUTY = 32, | |
17 | + }; | |
18 | + int i; | |
19 | + | |
20 | + clock_initialize(); | |
21 | + | |
22 | + for (i = 0; i < 2; ++i) { | |
23 | + motor_pwm_initialize(i); | |
24 | + motor_pwm_set_duty(i, MOTOR_PWM_CW, DUTY); | |
25 | + } | |
26 | + | |
27 | + while (1) { | |
28 | + ; | |
29 | + } | |
30 | +} |
@@ -1,7 +1,7 @@ | ||
1 | 1 | # taiyaki/sample |
2 | 2 | |
3 | 3 | ARCH = sh-elf |
4 | -SOURCE_DIR = ../ | |
4 | +SOURCE_DIR = .. | |
5 | 5 | include $(SOURCE_DIR)/build_rule.mk |
6 | 6 | |
7 | 7 | CFLAGS_FOR_BUILD = -DHOST_COMPILE -m2 -Wall -Werror -W $(INCLUDES_FOR_BUILD) |
@@ -18,8 +18,8 @@ | ||
18 | 18 | sci_write.mot \ |
19 | 19 | sci_echoback.mot \ |
20 | 20 | timer_1sec.mot \ |
21 | - motor_pwm.mot \ | |
22 | - motor_velocity.mot \ | |
21 | + motor_pwm_out.mot \ | |
22 | + motor_velocity_out.mot \ | |
23 | 23 | encoder_print.mot \ |
24 | 24 | |
25 | 25 | all : $(TARGET) |
@@ -32,14 +32,14 @@ | ||
32 | 32 | |
33 | 33 | .PHONY : all clean depend |
34 | 34 | ###################################################################### |
35 | -BASE_OBJ = $(SOURCE_DIR)/clock_initialize.o $(SOURCE_DIR)/imask_control.o $(SOURCE_DIR)/sci_control.o | |
35 | +BASE_OBJ = $(SOURCE_DIR)/clock_initialize.o $(SOURCE_DIR)/imask_control.o $(SOURCE_DIR)/sci_control.o $(SOURCE_DIR)/mtu2_initialize.o | |
36 | 36 | |
37 | 37 | sci_write.mot : sci_write.o $(BASE_OBJ) |
38 | 38 | sci_echoback.mot : sci_echoback.o $(BASE_OBJ) |
39 | 39 | timer_1sec.mot : timer_1sec.o $(BASE_OBJ) $(SOURCE_DIR)/timer_control.o itoa.o $(SOURCE_DIR)/std_string.o |
40 | 40 | encoder_print.mot : encoder_print.o |
41 | -motor_pwm.mot : motor_pwm.o | |
42 | -motor_velocity.mot : motor_velocity.o | |
41 | +motor_pwm_out.mot : motor_pwm_out.o $(BASE_OBJ) $(SOURCE_DIR)/motor_pwm.o | |
42 | +motor_velocity_out.mot : motor_velocity_out.o | |
43 | 43 | pwm_output.mot : pwm_output.o $(SOURCE_DIR)/pwm_control.o |
44 | 44 | servo_free.mot : servo_free.o |
45 | 45 |
@@ -46,6 +46,8 @@ | ||
46 | 46 | # DO NOT DELETE |
47 | 47 | |
48 | 48 | itoa.o: itoa.h |
49 | +motor_pwm_out.o: ../clock_initialize.h ../motor_pwm.h | |
50 | +motor_velocity_out.o: ../motor_velocity.h | |
49 | 51 | sci_echoback.o: ../clock_initialize.h ../imask_control.h ../sci_control.h |
50 | 52 | sci_echoback.o: ../interrupt_priority.h |
51 | 53 | sci_write.o: ../clock_initialize.h ../imask_control.h ../sci_control.h |