Skip to content

Commit

Permalink
Merge pull request #10 from PaulStoffregen/master
Browse files Browse the repository at this point in the history
Don't init with invalid mode & fix compiler warnings
  • Loading branch information
ladyada authored Dec 24, 2016
2 parents eaeeefa + ede7a97 commit 6a565b8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Adafruit_RA8875.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@ boolean Adafruit_RA8875::begin(enum RA8875sizes s) {
_width = 480;
_height = 272;
}
if (_size == RA8875_800x480) {
else if (_size == RA8875_800x480) {
_width = 800;
_height = 480;
}
else {
return false;
}

pinMode(_cs, OUTPUT);
digitalWrite(_cs, HIGH);
Expand Down Expand Up @@ -159,7 +162,7 @@ void Adafruit_RA8875::PLLinit(void) {
writeReg(RA8875_PLLC2, RA8875_PLLC2_DIV4);
delay(1);
}
if (_size == RA8875_800x480) {
else /* (_size == RA8875_800x480) */ {
writeReg(RA8875_PLLC1, RA8875_PLLC1_PLLDIV1 + 10);
delay(1);
writeReg(RA8875_PLLC2, RA8875_PLLC2_DIV4);
Expand Down Expand Up @@ -198,7 +201,7 @@ void Adafruit_RA8875::initialize(void) {
vsync_start = 8;
vsync_pw = 10;
}
else if (_size == RA8875_800x480)
else // (_size == RA8875_800x480)
{
pixclk = RA8875_PCSR_PDATL | RA8875_PCSR_2CLK;
hsync_nondisp = 26;
Expand Down

0 comments on commit 6a565b8

Please sign in to comment.