decrease SPI clock speed for 5110 LCD

This commit is contained in:
LowPowerLab 2015-12-18 15:11:42 -05:00
parent b0d7ffa18c
commit a46524de60
1 changed files with 4 additions and 5 deletions

View File

@ -207,7 +207,7 @@ void clearDisplay() {
} }
void refreshLCD() { void refreshLCD() {
SPI.setClockDivider(SPI_CLOCK_DIV16);
byte lcdwidth = lcd.getWidth(); byte lcdwidth = lcd.getWidth();
byte lcdheight = lcd.getHeight(); byte lcdheight = lcd.getHeight();
char c; char c;
@ -280,6 +280,7 @@ void refreshLCD() {
lcd.drawXBMP(0, lcdheight-xbmp_rssi_height, xbmp_rssi_width, xbmp_rssi_height, bmpPtr); lcd.drawXBMP(0, lcdheight-xbmp_rssi_height, xbmp_rssi_width, xbmp_rssi_height, bmpPtr);
lcd.drawStr(xbmp_rssi_width+1, 48, RSSIstr); lcd.drawStr(xbmp_rssi_width+1, 48, RSSIstr);
} while(lcd.nextPage()); } while(lcd.nextPage());
SPI.setClockDivider(SPI_CLOCK_DIV4);
} }
//******************************************** END LCD FUNCTIONS ******************************************************************************** //******************************************** END LCD FUNCTIONS ********************************************************************************
@ -643,14 +644,12 @@ void loop() {
newPacketReceived = true; newPacketReceived = true;
} }
//boolean newBatteryReading=false;
//if (readBattery()) newBatteryReading = true;
readBattery(); readBattery();
if (newPacketReceived)
if (newPacketReceived /*|| newBatteryReading*/)
{ {
newPacketReceived = false; newPacketReceived = false;
refreshLCD(); refreshLCD();
} }
LCD_BACKLIGHT(batteryLow); LCD_BACKLIGHT(batteryLow);
} }