Function Generator for TINF 2021

src/FuncGenMain_21.cpp

Committer:
stkiegerl
Date:
2021-03-09
Revision:
0:464b401734fd
Child:
1:dbd814e65f1d

File content as of revision 0:464b401734fd:

#include "mbed.h"
#include "Serial_HL.h"
#include "FuncGenFSST.h"

SerialBLK pc(USBTX, USBRX);
SvProtocol ua0(&pc);

void CommandHandler();

int main(void)
{
	pc.format(8,SerialBLK::None,1);
	pc.baud(115200); // 115200
	ua0.SvMessage("FuncGen"); // Meldung zum PC senden
	
	Timer stw; stw.start();
	while(1) {
		CommandHandler();
	  ua0.SvMessage("FuncGen is communicating"); // send test message - delete this line
    ThisThread::sleep_for(1000); // delete this line
		if( stw.read_ms()>10 ) { // 100Hz
			stw.reset();
			if( ua0.acqON ) {
			}
		}
	}
	return 1;
}

void CommandHandler()
{
	uint8_t cmd;
	if( !pc.IsDataAvail() )
		return;
}