Skip to content

Commit

Permalink
Fix HD44780 address calculation for 1604A display.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sh4rK committed Jan 31, 2018
1 parent 00ad2da commit 52998df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xpcc/driver/display/hd44780_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ xpcc::Hd44780<DATA, RW, RS, E>::setCursor(uint8_t column, uint8_t line)
this->column = (column <= this->lineWidth ? column : this->lineWidth);
this->line = (line <= this->lineCount ? line : this->lineCount);

uint8_t address = this->column + 0x40 * this->line;
uint8_t address = this->column + 0x40 * (this->line % 2);
if (this->line >= 2) {
address += 20;
address += 16;
}
while(!driver::writeAddress(address))
;
Expand Down

0 comments on commit 52998df

Please sign in to comment.