45 uint8_t ctune_4pf, ctune, ftune;
51 uart1_init(INC,MOD,SAMP);
53 print_welcome(
"pwm test\r\n");
54 pack_XTAL_CNTL(ctune_4pf, ctune, ftune, IBIAS);
57 switch(uart1_getc()) {
58 case '[':
if(ctune > 0) ctune -= 1;
break;
59 case ']':
if(ctune < 15) ctune += 1;
break;
60 case '-':
if(ftune > 0) ftune -= 1;
break;
61 case '=':
if(ftune < 31) ftune += 1;
break;
62 case ' ':
if(ctune_4pf) { ctune_4pf = 0; }
else { ctune_4pf = 1;}
break;
65 printf(
"ctune_4pf %d; ctune %d; ftune %d\n\r", ctune_4pf, ctune, ftune);
66 pack_XTAL_CNTL(ctune_4pf, ctune, ftune, IBIAS);