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.
Diff: main.cpp
- Revision:
- 1:4ff199bddbc1
- Child:
- 2:e3c085ac77f1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Mar 08 12:03:48 2016 +0900 @@ -0,0 +1,33 @@ +// main.cpp 2016/3/8 +#include "mbed.h" +#include "SimpleSerial.h" +#include "Memory.h" +#include "BaseEmuISP.h" + +SimpleSerial uart(USBTX, USBRX); +#if defined(TARGET_LPC1768)||defined(TARGET_LPC4088) +SimpleSerial dbg(p9, p10); +#elif defined(TARGET_NUCLEO_L152RE)||defined(TARGET_NUCLEO_F103RB) +SimpleSerial dbg(PB_10, PB_11); +#endif + +Memory mem(4096, 1024, 0x10000000); + +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 int Part() { return 0x00008242; } // LPC824M201JDH20 + 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); + isp.Reset(); + for(;;) { + isp.Poll(); + } +} +