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