User Tools

Site Tools

한국어

moacon:comxuntilevent:index

comxUntilEvent

void com0UntilEvent()
void com1UntilEvent()
void com2UntilEvent()

The event handler called when a data configured with the startComxUntilEvent is received on channel x.

#include "moacon500.h"
void cmain(void)
{
 openCom(0,115200,C8N1);              // Open serial channel 0
 startCom0UntilEvent(0x30);           // Begin receiving events when data 0x30 is received
 
 while(1) { }                         // Run forever
}
 
void com0UntilEvent(void)             // This function is called when data 0x30
{                                     // is received 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/comxuntilevent/index.txt · Last modified: 2016/04/14 11:07 (external edit)