Update dbSerial.

Signed-off-by: shennongmin <wupangfee@gmail.com>
This commit is contained in:
shennongmin
2015-07-30 10:27:23 +08:00
parent be00d097b3
commit cba2cce5a8
10 changed files with 5 additions and 14 deletions

View File

@@ -22,6 +22,9 @@
/* define serial for debug */
#define dbSerial Serial
/* define serial for communicate with Nextion screen */
#define nexSerial Serial2
#ifdef DEBUG_SERIAL_ENABLE
#define dbSerialPrint(a) dbSerial.print(a)
#define dbSerialPrintln(a) dbSerial.println(a)
@@ -32,7 +35,4 @@
#define dbSerialBegin(a)
#endif
/* define serial for communicate with Nextion screen */
#define nexSerial Serial2
#endif

View File

@@ -403,6 +403,7 @@ bool NexTouch::getBrightness(uint32_t *brightness)
*/
bool nexInit(void)
{
dbSerialBegin(9600);
nexSerial.begin(9600);
NexTouch::sendCommand("");
NexTouch::sendCommand("page 0");

View File

@@ -45,8 +45,7 @@ void b0PopCallback(void *ptr)
}
void setup(void)
{
dbSerialBegin(9600);
{
nexInit();
b0.attachPop(b0PopCallback, &b0);
dbSerialPrintln("setup done");

View File

@@ -39,7 +39,6 @@ void q0PopCallback(void *ptr)
void setup(void)
{
dbSerialBegin(9600);
nexInit();
q0.attachPop(q0PopCallback);
dbSerialPrintln("setup done");

View File

@@ -55,7 +55,6 @@ void hot1PopCallback(void *ptr)
void setup(void)
{
dbSerialBegin(9600);
nexInit();
hot0.attachPush(hot0PushCallback, &hot0);
hot0.attachPop(hot0PopCallback, &hot0);

View File

@@ -55,7 +55,6 @@ void page3PopCallback(void *ptr)
void setup(void)
{
dbSerialBegin(9600);
nexInit();
dbSerialPrintln("setup begin");

View File

@@ -45,7 +45,6 @@ void p0PopCallback(void *ptr)
void setup(void)
{
dbSerialBegin(9600);
nexInit();
p0.attachPop(p0PopCallback);
dbSerialPrintln("setup done");

View File

@@ -61,7 +61,6 @@ void buttonDownPopCallback(void *ptr)
void setup(void)
{
dbSerialBegin(9600);
nexInit();
btn_up.attachPop(buttonUpPopCallback);
btn_down.attachPop(buttonDownPopCallback);

View File

@@ -61,9 +61,6 @@ void buttonDownPopCallback(void *ptr)
void setup(void)
{
uint32_t brightness = 0;
dbSerialBegin(9600);
nexInit();
btn_up.attachPop(buttonUpPopCallback);
btn_down.attachPop(buttonDownPopCallback);

View File

@@ -80,7 +80,6 @@ void b1PopCallback(void *ptr)
void setup(void)
{
dbSerialBegin(9600);
nexInit();
dbSerialPrintln("setup done");
}