49 uart1_init(INC,MOD,SAMP);
52 printf(
"pwm test\r\n");
53 pwm_init_stopped(TMR0, 12000000, x);
54 pwm_init_stopped(TMR1, 12000000, x);
55 TMR0->ENBL |= TMR_ENABLE_BIT(TMR0) | TMR_ENABLE_BIT(TMR1);
58 printf(
"duty %d = %d%%\r\n", x, ((x * 100 + 32768) / 65536));
59 switch(uart1_getc()) {
60 case '[': x -= 1;
break;
61 case ']': x += 1;
break;
62 case '-': x -= 32;
break;
63 case '=': x += 32;
break;
64 case '_': x -= 512;
break;
65 case '+': x += 512;
break;
67 case '`': x = 65535 * 0/10;
break;
68 case '1': x = 65535 * 1/10;
break;
69 case '2': x = 65535 * 2/10;
break;
70 case '3': x = 65535 * 3/10;
break;
71 case '4': x = 65535 * 4/10;
break;
72 case '5': x = 65535 * 5/10;
break;
73 case '6': x = 65535 * 6/10;
break;
74 case '7': x = 65535 * 7/10;
break;
75 case '8': x = 65535 * 8/10;
break;
76 case '9': x = 65535 * 9/10;
break;
77 case '0': x = 65535 * 10/10;
break;