Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- va009039
- Date:
- 2016-03-12
- Revision:
- 2:e3c085ac77f1
- Parent:
- 1:4ff199bddbc1
- Child:
- 3:ccc673a10485
File content as of revision 2:e3c085ac77f1:
// main.cpp 2016/3/10 // UART ISP emulator #include "mbed.h" #include "SimpleSerial.h" #include "Memory.h" #include "BaseEmuISP.h" SimpleSerial uart(USBTX, USBRX); #if defined(TARGET_LPC1768)||defined(TARGET_LPC4088) RawSerial dbg(p9, p10); #elif defined(TARGET_NUCLEO_L152RE)||defined(TARGET_NUCLEO_F103RB) RawSerial dbg(PB_10, PB_11); #else #error "target error" #endif Memory mem; class emuISP : public BaseEmuISP { virtual int Getch() {return uart.readable() ? uart.getc() : -1;} virtual void Putch(int c) {uart.putc(c);} virtual void DebugPutch(int c) {dbg.putc(c);} virtual void WriteData(int addr, int c) {mem.Write(addr, c);} virtual int ReadData(int addr) {return mem.Read(addr);} virtual void CopyData(int dst, int src, int count) {mem.Copy(dst, src, count);} } isp; int main() { uart.baud(9600); dbg.baud(115200); isp.Reset(); for(;;) { isp.Poll(); } }