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: BaseEmuISP.h
- Revision:
- 5:e2c275b33bbf
- Parent:
- 4:05f33cc747fd
--- a/BaseEmuISP.h Wed Mar 23 09:11:05 2016 +0900 +++ b/BaseEmuISP.h Fri Mar 25 06:08:40 2016 +0900 @@ -1,10 +1,13 @@ -// BaseEmuISP.h 2016/3/23 +// BaseEmuISP.h 2016/3/25 #pragma once #include <stdint.h> #include "myvector.h" +#include "mystring.h" -typedef myvector<int> vint_t; -typedef myvector<uint8_t> vbyte_t; +typedef myvector<char*> vec_charPtr_t; +typedef myvector<int> vec_int_t; +typedef myvector<uint8_t> vec_byte_t; +typedef mystring string_t; enum Mode_t { M_RESET = 0, @@ -64,21 +67,21 @@ private: bool sync(); ReturnCode_t cmd(const char* s); - ReturnCode_t cmd_u(vint_t ¶m); - ReturnCode_t cmd_b(vint_t ¶m); - ReturnCode_t cmd_a(vint_t ¶m); - ReturnCode_t cmd_w(vint_t ¶m); - ReturnCode_t cmd_r(vint_t ¶m); - ReturnCode_t cmd_p(vint_t ¶m); - ReturnCode_t cmd_c(vint_t ¶m); - ReturnCode_t cmd_g(vint_t ¶m); - ReturnCode_t cmd_e(vint_t ¶m); - ReturnCode_t cmd_i(vint_t ¶m); - ReturnCode_t cmd_j(vint_t ¶m); - ReturnCode_t cmd_k(vint_t ¶m); - ReturnCode_t cmd_m(vint_t ¶m); - ReturnCode_t cmd_n(vint_t ¶m); - ReturnCode_t cmd_s(vint_t ¶m); + ReturnCode_t cmd_u(vec_int_t ¶m); + ReturnCode_t cmd_b(vec_int_t ¶m); + ReturnCode_t cmd_a(vec_int_t ¶m); + ReturnCode_t cmd_w(vec_int_t ¶m); + ReturnCode_t cmd_r(vec_int_t ¶m); + ReturnCode_t cmd_p(vec_int_t ¶m); + ReturnCode_t cmd_c(vec_int_t ¶m); + ReturnCode_t cmd_g(vec_int_t ¶m); + ReturnCode_t cmd_e(vec_int_t ¶m); + ReturnCode_t cmd_i(vec_int_t ¶m); + ReturnCode_t cmd_j(vec_int_t ¶m); + ReturnCode_t cmd_k(vec_int_t ¶m); + ReturnCode_t cmd_m(vec_int_t ¶m); + ReturnCode_t cmd_n(vec_int_t ¶m); + ReturnCode_t cmd_s(vec_int_t ¶m); bool cmd_w_data(); bool cmd_r_data(); void putln(const char *s); @@ -87,23 +90,17 @@ int seq; bool echoFlag; bool lockFlag; - bool line_proc(); - struct { - void Clear() { pos = 0; } - size_t Size() { return pos; } - const char *C_str() {return buf; } - void operator +=(int c) { if (pos < sizeof(buf)-2) buf[pos++] = c; buf[pos] = '\0'; } - bool operator ==(const char* s) { return strcmp(buf, s) == 0; } - bool operator ==(int n) { return atoi(buf) == n; } - size_t pos; - char buf[64]; - } line; + string_t line; + bool lineProc(); int freq; int addr; - int dataLine; - int dataCount; - int dataCurrent; - int dataCksum; + struct { + vec_byte_t Buf; + int Line; + int Count; + int Current; + int Cksum; + } data; struct { uint8_t Major; uint8_t Minor;