diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..723ef36f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/NexPage.cpp b/NexPage.cpp index e6ca3504..bf381312 100644 --- a/NexPage.cpp +++ b/NexPage.cpp @@ -36,3 +36,16 @@ bool NexPage::show(void) return recvRetCommandFinished(); } +bool NexPage::setPic(uint32_t number) +{ + char buf[10] = {0}; + String cmd; + + utoa(number, buf, 10); + cmd += getObjName(); + cmd += ".pic="; + cmd += buf; + + sendCommand(cmd.c_str()); + return recvRetCommandFinished(); +} \ No newline at end of file diff --git a/NexPage.h b/NexPage.h index c833e700..211a4c11 100644 --- a/NexPage.h +++ b/NexPage.h @@ -42,6 +42,16 @@ class NexPage: public NexTouch * @return true if success, false for faileure. */ bool show(void); + + /** + * Set picture's number. + * + * @param number -the picture number. + * + * @retval true - success. + * @retval false - failed. + */ + bool setPic(uint32_t number); }; /** * @} diff --git a/NexUpload.cpp b/NexUpload.cpp index ff85eb92..0689c194 100644 --- a/NexUpload.cpp +++ b/NexUpload.cpp @@ -14,9 +14,13 @@ */ #include "NexUpload.h" -#include //#define USE_SOFTWARE_SERIAL + +#ifdef USE_SOFTWARE_SERIAL +#include +#endif + #ifdef USE_SOFTWARE_SERIAL SoftwareSerial dbSerial(3, 2); /* RX:D3, TX:D2 */ #define DEBUG_SERIAL_ENABLE