Use NULL instead of strlen
for printing strings
This makes more sense and also removes the dependency for `string.h`.
This commit is contained in:
parent
47bd5e45f7
commit
c48e4a31ab
1 changed files with 1 additions and 2 deletions
|
@ -4,7 +4,6 @@
|
||||||
#include <util/delay.h>
|
#include <util/delay.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#define SPI_PORT PORTB
|
#define SPI_PORT PORTB
|
||||||
#define SPI_DDR DDRB
|
#define SPI_DDR DDRB
|
||||||
|
@ -255,7 +254,7 @@ static void lcd_write_character_page(const char character,
|
||||||
static void lcd_write_string_page(const char* string,
|
static void lcd_write_string_page(const char* string,
|
||||||
const uint8_t page,
|
const uint8_t page,
|
||||||
const bool invert) {
|
const bool invert) {
|
||||||
for (uint8_t i = 0; i < strlen(string); i++) {
|
for (uint8_t i = 0; string[i] != 0; i++) {
|
||||||
lcd_write_kerning(2, invert);
|
lcd_write_kerning(2, invert);
|
||||||
lcd_write_character_page(string[i], page, invert);
|
lcd_write_character_page(string[i], page, invert);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue