void boardInitialisation(void) { WDT_A_hold( WDT_A_BASE ); //MSP's WDT is turned on by default. If you don't stop it, at some point, your system'll restart unusedPinsConfiguration(); //To minimise power consumption, all pins needs to be initialised. Floating pins waste a lot of power pinConfiguration(); //This function will configure all the pins used in this project clockConfiguration(); //Will configure MCLK = SMCLK = 8MHz and ACLK to 32768 Hz ADCConfiguration(); //Will configure ADC and memory location to which it'll write to timerConfiguration(); //Will configure timer to tick once every 8 seconds }
int main(void) { unsigned long i; // Configurations. clockConfiguration(); moduleEnable(); // Port. portSetup(); // USB. usbModuleSetup(); usbPipeSetup(); usbInterruptSetup(); // irqConfiguration(); DEBUGFIFO_Init(); //HW_Init(); // TODO: add application code here DEBUGFIFO_OutLine("============================"); DEBUGFIFO_OutLine("=== RX62 USB TEST Start! ==="); DEBUGFIFO_OutLine("============================"); DEBUGFIFO_OutLine(""); // Wait for setup; for(i = 0; i < 0x017FFFFF; i++); ledOn(); DEBUGFIFO_OutLine("LED ON."); while (1) { unsigned char c[3] = {0x00, 0x40, 0x40}; for(i = 0; i < 0x00400000; i++); DEBUGFIFO_OutLine("Loop!"); p_pipe2Buf = &c[0]; pipe2BufCnt = 3; USB0.BRDYENB.BIT.PIPE1BRDYE = 1; } return 0; }