Rev 195 | Rev 360 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 195 | Rev 196 | ||
---|---|---|---|
Line 193... | Line 193... | ||
193 | // configure the servo pins |
193 | // configure the servo pins |
194 | GPIO_StructInit(&GPIO_InitStructure); |
194 | GPIO_StructInit(&GPIO_InitStructure); |
195 | GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput; |
195 | GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput; |
196 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4; |
196 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4; |
197 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ; |
197 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ; |
198 | GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Enable; |
198 | GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Enable; |
199 | GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt2; //TIM2_OCMP1 |
199 | GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt2; //TIM2_OCMP1 |
200 | GPIO_Init(GPIO6, &GPIO_InitStructure); |
200 | GPIO_Init(GPIO6, &GPIO_InitStructure); |
Line 201... | Line 201... | ||
201 | 201 | ||
202 | GPIO_StructInit(&GPIO_InitStructure); |
202 | GPIO_StructInit(&GPIO_InitStructure); |
203 | GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput; |
203 | GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput; |
204 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5; |
204 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5; |
205 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
205 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
206 | GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Enable; |
206 | GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Enable; |
207 | GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt2; //TIM2_OCMP2 |
207 | GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt2; //TIM2_OCMP2 |
Line 208... | Line 208... | ||
208 | GPIO_Init(GPIO6, &GPIO_InitStructure); |
208 | GPIO_Init(GPIO6, &GPIO_InitStructure); |
Line 263... | Line 263... | ||
263 | // configure the servo pins as input |
263 | // configure the servo pins as input |
264 | GPIO_StructInit(&GPIO_InitStructure); |
264 | GPIO_StructInit(&GPIO_InitStructure); |
265 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
265 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
266 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4; |
266 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4; |
267 | GPIO_InitStructure.GPIO_Type = GPIO_Type_OpenCollector; |
267 | GPIO_InitStructure.GPIO_Type = GPIO_Type_OpenCollector; |
268 | GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Disable; |
268 | GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Disable; |
269 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
269 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
270 | GPIO_Init(GPIO6, &GPIO_InitStructure); |
270 | GPIO_Init(GPIO6, &GPIO_InitStructure); |
Line 271... | Line 271... | ||
271 | 271 | ||
272 | GPIO_StructInit(&GPIO_InitStructure); |
272 | GPIO_StructInit(&GPIO_InitStructure); |
273 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
273 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
274 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5; |
274 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5; |
275 | GPIO_InitStructure.GPIO_Type = GPIO_Type_OpenCollector; |
275 | GPIO_InitStructure.GPIO_Type = GPIO_Type_OpenCollector; |
276 | GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Disable; |
276 | GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Disable; |
277 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
277 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
278 | GPIO_Init(GPIO6, &GPIO_InitStructure); |
278 | GPIO_Init(GPIO6, &GPIO_InitStructure); |