コード例 #1
0
ファイル: main.c プロジェクト: pacoard/TFG_2016
void main(void)
{
    WDTCTL = WDTPW + WDTHOLD;		// Halt the dog

    // MSP430 USB requires a Vcore setting of at least 2.  2 is high enough
	// for 8MHz MCLK, below.
    PMM_setVCore(PMM_BASE, PMM_CORE_LEVEL_2);

    initPorts();           // Config all the GPIOS for low-power (output low)
    initClocks(8000000);   // Config clocks. MCLK=SMCLK=FLL=8MHz; ACLK=REFO=32kHz
    bcUartInitLaunchpad();   // Init the back-channel UART for F5529 launchpad (9600 bps).
    //bcUartInitPGN();        // Init the back-channel UART for PGN (9600 bps).
    switchMessage = 0;
    __buttonsInit();
    __enable_interrupt();  // Enable interrupts globally

    while(1)
    {
       // Look for rcv'ed command on the backchannel UART. If any, process.
       rxByteCount = bcUartReadCommandTimeout(rx_buf_bcuart);
       if(rxByteCount != -1)
       {
         processReceivedFrame(rx_buf_bcuart, rxByteCount);
       }
       else // Timeout
       {
         // Do other things
//         tx_buf_bcuart[0] = 0xCC;
//         tx_buf_bcuart[1] = 0xDD;
//         bcUartSend(tx_buf_bcuart, 2);
       }
    }
}
コード例 #2
0
ファイル: MacBase.cpp プロジェクト: ADTL/stm32plus
    void MacBase::handleReceiveInterrupt() {

      FrameTypeDef frame;

      // loop over received frames

      for(frame=ETH_Get_Received_Frame_interrupt(_params.mac_receiveBufferCount);frame.buffer;frame=ETH_Get_Received_Frame_interrupt(_params.mac_receiveBufferCount))
        processReceivedFrame(frame);
    }