![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ok see #define to of code uses MODSERIAL - buffered serial
main.cpp
- Committer:
- avnisha
- Date:
- 2014-03-19
- Revision:
- 0:6bd2bff61284
File content as of revision 0:6bd2bff61284:
// // needed for backward code compatibility !!!! // #define _uidx _serial.index #include "mbed.h" #include "MODDMA.h" #include "MODSERIAL.h" /* * Uses DMA to send data to buffer attached to a serial device */ DigitalOut led1(LED1); DigitalOut led4(LED4); MODSERIAL pc(USBTX, USBRX); MODDMA dma; class FOO { public: void dmaCallback(MODSERIAL_IRQ_INFO *q) { led4 = 1; } }; FOO foo; int main() { char s[] = "This is a DMA transfer test\n\r"; pc.baud( 9600 ); pc.MODDMA( &dma ); pc.attach_dmaSendComplete( &foo, &FOO::dmaCallback ); pc.dmaSend( s, sizeof(s) ); while(1) { led1 = !led1; wait(0.2); pc.dmaSend( s, sizeof(s) ); } }