(Loading...)

lundi 23 janvier 2006

Test Prettifier

Test d'intégration de coloration syntaxique sur BlogSpot.

Code:
unsigned char readbuff[64] absolute 0x500;   // Buffers should be in USB RAM, please consult datasheet
unsigned char writebuff[64] absolute 0x540;

char cnt;
char kk;

void interrupt(){
   USB_Interrupt_Proc();                   // USB servicing is done inside the interrupt
}
void init()
 {
   // Ports Configuration
  TRISA = 0;
  PORTA=0;
  TRISB = 0;
  PORTB=0;
 }


void main(void){
  ADCON1 |= 0x0F;                         // Configure all ports with analog function as digital
  CMCON  |= 7;                            // Disable comparators
  init();
  HID_Enable(&readbuff,&writebuff);       // Enable HID communication

  while(1){

    while(!HID_Read())
      ;
           if(readbuff[0]==0)
              PORTA.F2=1;
              else if (readbuff[0]==1)
              PORTA.F1=1;
              else if (readbuff[0]==3)
              PORTB.F3=1;
             else if (readbuff[0]==4)
              PORTB.F4=1;
              else if (readbuff[0]==5)
              PORTB.F5=1;
       Delay_ms(1000);
       PORTA.F2=0;
       PORTA.F1=0;
       PORTB.F3=0;
       PORTB.F4=0;
       PORTB.F5=0;
    for(cnt=0;cnt<64 1="" 2="" 3="" 4="" cnt="" ligne="" pre="" readbuff="" rite="" while="" writebuff="">