oled printf
This commit is contained in:
@ -35,6 +35,6 @@ void oled_PrintLine(void);
|
|||||||
|
|
||||||
void oledClear();
|
void oledClear();
|
||||||
void oledPrint(char msg[]);
|
void oledPrint(char msg[]);
|
||||||
|
void oledPrintf(const char *format, ...);
|
||||||
|
|
||||||
#endif /* OLED_H_ */
|
#endif /* OLED_H_ */
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <oled.h>
|
#include <oled.h>
|
||||||
#include <oled-fonts.h>
|
#include <oled-fonts.h>
|
||||||
@ -561,4 +563,14 @@ void oledPrint(char msg[]) {
|
|||||||
lines[MAX_LINES - 1][MAX_CHARS - 1] = 0;
|
lines[MAX_LINES - 1][MAX_CHARS - 1] = 0;
|
||||||
oled_P6x8Str(1, MAX_LINES - 1, lines[MAX_LINES - 1]);
|
oled_P6x8Str(1, MAX_LINES - 1, lines[MAX_LINES - 1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void oledPrintf(const char *format, ...) {
|
||||||
|
va_list vl;
|
||||||
|
va_start(vl, format);
|
||||||
|
char buf[MAX_CHARS+1];
|
||||||
|
vsnprintf(buf, MAX_CHARS, format, vl);
|
||||||
|
va_end(vl);
|
||||||
|
oledPrint(buf);
|
||||||
|
}
|
||||||
|
@ -77,7 +77,7 @@ static void wizDHCPAssign() {
|
|||||||
show(LED_GREEN, ON);
|
show(LED_GREEN, ON);
|
||||||
coloredMsg(LOG_BLUE, false, "wizda, network is available");
|
coloredMsg(LOG_BLUE, false, "wizda, network is available");
|
||||||
|
|
||||||
oledPrint("Address available");
|
oledPrintf("Address: %d.%d.%d.%d", netInfo.ip[0], netInfo.ip[1], netInfo.ip[2], netInfo.ip[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wizDHCPUpdate() {
|
static void wizDHCPUpdate() {
|
||||||
|
Reference in New Issue
Block a user