Skip to content

Commit b8b0f9d

Browse files
author
Harry
committed
modified oled init
1 parent 682582e commit b8b0f9d

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/oled/OLEDDisplay.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ bool OLEDDisplay::init() {
6767
resetDisplay(16);
6868
sendInitCommands();
6969

70+
clear();
71+
#ifdef OLEDDISPLAY_DOUBLE_BUFFER
72+
memset(buffer_back, 1, displayBufferSize);
73+
#endif
74+
display();
7075
return true;
7176
}
7277

@@ -95,12 +100,6 @@ void OLEDDisplay::resetDisplay(uint8_t rstPin) {
95100
digitalWrite(rstPin,LOW);
96101
delay(100);
97102
digitalWrite(rstPin,HIGH);
98-
99-
clear();
100-
#ifdef OLEDDISPLAY_DOUBLE_BUFFER
101-
memset(buffer_back, 1, displayBufferSize);
102-
#endif
103-
display();
104103
}
105104

106105
void OLEDDisplay::setColor(OLEDDISPLAY_COLOR color) {
@@ -495,11 +494,11 @@ void OLEDDisplay::drawString(int16_t xMove, int16_t yMove, String strUser) {
495494
// unsigned char c = 0,i = 0,j = 0,ch[3];
496495
// String strUser;
497496
//
498-
// ch[0] = Num/100 + 48;//����ʮ���Ƶ�48��Ϊ�˸�Num����ASCLL��ĸ�4λ0011 0000��
497+
// ch[0] = Num/100 + 48;//锟斤拷锟斤拷十锟斤拷锟狡碉拷48锟斤拷为锟剿革拷Num锟斤拷锟斤拷ASCLL锟斤拷母锟�4位0011 0000锟斤拷
499498
// ch[1] = Num%100/10 + 48;
500499
// ch[2] = Num%10 + 48;
501500
//
502-
// if(ch[0] == 48) //���ڰ�����ÿλΪ"0"ʱ����ɿո񣨼�����ʾ�
501+
// if(ch[0] == 48) //锟斤拷锟节帮拷锟斤拷锟斤拷每位为"0"时锟斤拷锟斤拷煽崭瘢锟斤拷锟斤拷锟绞撅拷锟
503502
// {
504503
// ch[0] = 32;
505504
// if(ch[1] == 48)

0 commit comments

Comments
 (0)