comparison main.c @ 5:efa2c22266e3

PWM control LED backlight. Not sure why the AFIO clock needs to be on for this but not, say USART.
author Daniel O'Connor <darius@dons.net.au>
date Fri, 06 Jan 2012 09:46:28 +1030
parents 2c87e30c982d
children 9404b9869c27
comparison
equal deleted inserted replaced
4:2c87e30c982d 5:efa2c22266e3
195 if (status & 1 << i) { 195 if (status & 1 << i) {
196 fputs(flstattbl[i], stdout); 196 fputs(flstattbl[i], stdout);
197 fputs(" ", stdout); 197 fputs(" ", stdout);
198 } 198 }
199 printf("(0x%02x)\r\n", status); 199 printf("(0x%02x)\r\n", status);
200 } else if (!strncmp("pwm ", cmd.buf, 4)) {
201 lcd_setpwm(atoi(cmd.buf + 4));
200 } else if (!strncmp("zz", cmd.buf, 2)) { 202 } else if (!strncmp("zz", cmd.buf, 2)) {
201 NVIC_SystemReset(); 203 NVIC_SystemReset();
202 } else { 204 } else {
203 printf("Unknown command\r\n"); 205 printf("Unknown command\r\n");
204 } 206 }
224 * 226 *
225 * This resets the RTC etc back to 0 so probably only useful under user command 227 * This resets the RTC etc back to 0 so probably only useful under user command
226 BKP_DeInit(); 228 BKP_DeInit();
227 */ 229 */
228 230
229 /* Enable LSE */ 231 /* Enable Low Speed External clock */
230 RCC_LSEConfig(RCC_LSE_ON); 232 RCC_LSEConfig(RCC_LSE_ON);
231 233
232 /* Wait till LSE is ready */ 234 /* Wait till LSE is ready */
233 while (RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET) 235 while (RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET)
234 ; 236 ;