94,10 → 94,14 |
pwm_init(); // Initialize the PWM output driver |
timers_init(); // Initialize timers |
intx_init(); |
// port_b_int_init(); // Initialze Port B interrupt handler |
port_b_int_init(); // Initialze Port B interrupt handler |
interrupt_enable(); // Enable high-priority interrupts and low-priority interrupts |
interrupt_init(); // Initialize the interrupt priorities |
|
// Set all ports as digial I/O |
ANCON0 = 0xFF; |
ANCON1 = 0x1F; |
|
// Configure the hardware i2c device as a slave |
#ifdef _MASTER |
i2c_configure_master(); |
143,7 → 147,7 |
// Read 2 bytes back |
i2c_master_recv(0x5F, 2); |
while (i2c_master_busy()); |
Delay10KTCYx(100); |
// Delay10KTCYx(100); |
} |
#endif |
|
279,28 → 283,28 |
/* -----------------------------------------------------------*/ |
/* --- Port B Interrupt Handlers -----------------------------*/ |
case MSGTYPE_PORTB_4_DOWN: |
|
DBG_PRINT_MAIN("Main: Port B4 Down\r\n"); |
break; |
case MSGTYPE_PORTB_4_UP: |
|
DBG_PRINT_MAIN("Main: Port B4 Up\r\n"); |
break; |
case MSGTYPE_PORTB_5_DOWN: |
|
DBG_PRINT_MAIN("Main: Port B5 Down\r\n"); |
break; |
case MSGTYPE_PORTB_5_UP: |
|
DBG_PRINT_MAIN("Main: Port B5 Up\r\n"); |
break; |
case MSGTYPE_PORTB_6_DOWN: |
|
DBG_PRINT_MAIN("Main: Port B6 Down\r\n"); |
break; |
case MSGTYPE_PORTB_6_UP: |
|
DBG_PRINT_MAIN("Main: Port B6 Up\r\n"); |
break; |
case MSGTYPE_PORTB_7_DOWN: |
|
DBG_PRINT_MAIN("Main: Port B7 Down\r\n"); |
break; |
case MSGTYPE_PORTB_7_UP: |
|
DBG_PRINT_MAIN("Main: Port B7 Up\r\n"); |
break; |
/* -----------------------------------------------------------*/ |
default: |