changed c++ comments to c comments using comment.sh script.
This commit is contained in:
@@ -29,10 +29,10 @@
|
||||
#include <stdint.h>
|
||||
#include "hardware.h"
|
||||
|
||||
// define this to enable ICD
|
||||
//#define USE_ICD
|
||||
/* define this to enable ICD */
|
||||
/*#define USE_ICD */
|
||||
|
||||
// Configuration Bits
|
||||
/* Configuration Bits */
|
||||
#pragma config OSC = HS
|
||||
#pragma config PWRT = ON
|
||||
#pragma config BOR = ON, BORV = 42
|
||||
@@ -59,12 +59,12 @@
|
||||
#pragma config EBTRB = OFF
|
||||
|
||||
#ifdef USE_ICD
|
||||
#pragma config WDT = OFF, WDTPS = 128
|
||||
#pragma config DEBUG = ON
|
||||
#pragma config WDT = OFF, WDTPS = 128
|
||||
#pragma config DEBUG = ON
|
||||
#else
|
||||
#pragma config WDT = ON, WDTPS = 128
|
||||
#pragma config DEBUG = OFF
|
||||
#endif /* USE_ICD */
|
||||
#pragma config WDT = ON, WDTPS = 128
|
||||
#pragma config DEBUG = OFF
|
||||
#endif /* USE_ICD */
|
||||
|
||||
#pragma romdata
|
||||
|
||||
@@ -76,56 +76,55 @@
|
||||
*****************************************************************************/
|
||||
void init_hardware(void)
|
||||
{
|
||||
// If the processor gets a power on reset then we can do something.
|
||||
// We should not get a reset unless there has been
|
||||
// some kind of power line disturbance.
|
||||
if (RCONbits.POR)
|
||||
{
|
||||
//do something special!
|
||||
}
|
||||
/* If the processor gets a power on reset then we can do something. */
|
||||
/* We should not get a reset unless there has been */
|
||||
/* some kind of power line disturbance. */
|
||||
if (RCONbits.POR) {
|
||||
/*do something special! */
|
||||
}
|
||||
|
||||
GLOBAL_INT_DISABLE();
|
||||
GLOBAL_INT_DISABLE();
|
||||
|
||||
/* Setup PORT A */
|
||||
TRISA=PORT_A_TRIS_MASK;
|
||||
/* Setup PORT A */
|
||||
TRISA = PORT_A_TRIS_MASK;
|
||||
|
||||
/* PORT A can have analog inputs or digital IO */
|
||||
ADCON1 = NO_ANALOGS;
|
||||
/* PORT A can have analog inputs or digital IO */
|
||||
ADCON1 = NO_ANALOGS;
|
||||
|
||||
/* Setup PORT B */
|
||||
TRISB=PORT_B_TRIS_MASK;
|
||||
/* Setup PORT B */
|
||||
TRISB = PORT_B_TRIS_MASK;
|
||||
|
||||
/* Setup PORT C */
|
||||
TRISC=PORT_C_TRIS_MASK;
|
||||
/* Setup PORT C */
|
||||
TRISC = PORT_C_TRIS_MASK;
|
||||
|
||||
/* setup zero cross interrupt to trigger on a low to high edge */
|
||||
INTCON2bits.INTEDG0 = 1;
|
||||
/* setup zero cross interrupt to trigger on a low to high edge */
|
||||
INTCON2bits.INTEDG0 = 1;
|
||||
|
||||
// setup ABUS
|
||||
//ABUS_LED_OFF();
|
||||
//SSPADD = ABUS_DEFAULT_ADDR;
|
||||
//SSPCON1 = (ABUS_SLAVE_MASK | ABUS_CLK_ENABLE | ABUS_MODE_SETUP);
|
||||
//ABUS_Clear_SSPBUF();
|
||||
/* setup ABUS */
|
||||
/*ABUS_LED_OFF(); */
|
||||
/*SSPADD = ABUS_DEFAULT_ADDR; */
|
||||
/*SSPCON1 = (ABUS_SLAVE_MASK | ABUS_CLK_ENABLE | ABUS_MODE_SETUP); */
|
||||
/*ABUS_Clear_SSPBUF(); */
|
||||
|
||||
// setup timer2 to reset every 1ms
|
||||
CloseTimer2();
|
||||
PR2 = 250;
|
||||
OpenTimer2(T2_PS_1_4 & T2_POST_1_5 & 0x7F);
|
||||
/* setup timer2 to reset every 1ms */
|
||||
CloseTimer2();
|
||||
PR2 = 250;
|
||||
OpenTimer2(T2_PS_1_4 & T2_POST_1_5 & 0x7F);
|
||||
|
||||
// Setup our interrupt priorities ---------> all low priority
|
||||
RCONbits.IPEN = 1;
|
||||
IPR1 = 0;
|
||||
IPR2 = 0;
|
||||
INTCON2bits.TMR0IP = 0;
|
||||
INTCON2bits.RBIP = 0;
|
||||
INTCON3 = 0;
|
||||
/* Setup our interrupt priorities ---------> all low priority */
|
||||
RCONbits.IPEN = 1;
|
||||
IPR1 = 0;
|
||||
IPR2 = 0;
|
||||
INTCON2bits.TMR0IP = 0;
|
||||
INTCON2bits.RBIP = 0;
|
||||
INTCON3 = 0;
|
||||
|
||||
/* Enable interrupts */
|
||||
TIMER2_INT_ENABLE();
|
||||
PERIPHERAL_INT_ENABLE();
|
||||
GLOBAL_INT_ENABLE();
|
||||
/* Enable interrupts */
|
||||
TIMER2_INT_ENABLE();
|
||||
PERIPHERAL_INT_ENABLE();
|
||||
GLOBAL_INT_ENABLE();
|
||||
|
||||
// Turn on the Zero cross interrupt
|
||||
INTCONbits.INT0F = 0;
|
||||
INTCONbits.INT0E = 1;
|
||||
/* Turn on the Zero cross interrupt */
|
||||
INTCONbits.INT0F = 0;
|
||||
INTCONbits.INT0E = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user