User Tools

Site Tools

한국어

moacon:comxevent:index

comxEvent

void com0Event ( )
void com1Event ( )
void com2Event ( )

The event handler called when a receive event occurs on serial channel x (x=0 or 1 or 2).

#include "moacon500.h"
void cmain(void)
{
 openCom(0,115200,C8N1);           // Open serial channel 0
 startCom0Event();                 // Begin receiving events on channel 0
 
 while(1) { }                      // Run forever
}
void com0Event(void)               // This function will be called when an event
{                                  // occurs on channel 0
 while (comLen(0) > 0)             // Continue until all data is processed.
 {
   comPut(0, comGet(0));           // Echo data back to sender
 }
} 

go MOACON home

moacon/comxevent/index.txt · Last modified: 2016/04/14 11:07 (external edit)