Rev 483 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 483 | Rev 489 | ||
---|---|---|---|
Line 174... | Line 174... | ||
174 | TIM2->CR1 |= CR1_OLVL2_MASK; // make next a high pulse |
174 | TIM2->CR1 |= CR1_OLVL2_MASK; // make next a high pulse |
175 | } |
175 | } |
176 | TIM2->OC2R += pulselen; |
176 | TIM2->OC2R += pulselen; |
177 | } |
177 | } |
178 | IDISABLE; |
178 | IDISABLE; |
179 | */ |
179 | */ |
180 | VIC0->VAR = 0xFF; // write any value to VIC0 Vector address register |
180 | VIC0->VAR = 0xFF; // write any value to VIC0 Vector address register |
181 | } |
181 | } |
Line 182... | Line 182... | ||
182 | 182 | ||
183 | //---------------------------------------------------------------------------------------------------- |
183 | //---------------------------------------------------------------------------------------------------- |
184 | // Servo Timer |
184 | // Servo Timer |
185 | //---------------------------------------------------------------------------------------------------- |
185 | //---------------------------------------------------------------------------------------------------- |
186 | void TIMER2_Init(void) |
186 | void TIMER2_Init(void) |
187 | { |
187 | { |
188 | /* |
188 | /* |
189 | GPIO_InitTypeDef GPIO_InitStructure; |
189 | GPIO_InitTypeDef GPIO_InitStructure; |
Line 190... | Line 190... | ||
190 | TIM_InitTypeDef TIM_InitStructure; |
190 | TIM_InitTypeDef TIM_InitStructure; |
Line 246... | Line 246... | ||
246 | |
246 | |
247 | TIM_CounterCmd(TIM2, TIM_CLEAR); // reset timer |
247 | TIM_CounterCmd(TIM2, TIM_CLEAR); // reset timer |
Line 248... | Line 248... | ||
248 | TIM_CounterCmd(TIM2, TIM_START); // start the timer |
248 | TIM_CounterCmd(TIM2, TIM_START); // start the timer |
249 | |
249 | |
250 | UART1_PutString("ok\r\n"); |
250 | UART1_PutString("ok\r\n"); |
Line 251... | Line 251... | ||
251 | */ |
251 | */ |
252 | } |
252 | } |
253 | 253 | ||
Line 281... | Line 281... | ||
281 | GPIO_InitStructure.GPIO_Type = GPIO_Type_OpenCollector; |
281 | GPIO_InitStructure.GPIO_Type = GPIO_Type_OpenCollector; |
282 | GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Disable; |
282 | GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Disable; |
283 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
283 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
284 | GPIO_Init(GPIO6, &GPIO_InitStructure); |
284 | GPIO_Init(GPIO6, &GPIO_InitStructure); |
285 | } |
285 | } |
286 | */ |
- | |
287 | 286 | */ |
|
- | 287 |