diff --git a/kk_ihex.h b/kk_ihex.h index 589f010..79119fe 100644 --- a/kk_ihex.h +++ b/kk_ihex.h @@ -106,7 +106,7 @@ #ifndef KK_IHEX_H #define KK_IHEX_H -#define KK_IHEX_VERSION "2015-02-26" +#define KK_IHEX_VERSION "2015-03-04" #include diff --git a/kk_ihex_read.c b/kk_ihex_read.c index 9e85064..cc372b0 100644 --- a/kk_ihex_read.c +++ b/kk_ihex_read.c @@ -90,7 +90,7 @@ ihex_end_read (struct ihex_state * const ihex) { } void -ihex_read_byte (struct ihex_state * const ihex, const int byte) { +ihex_read_byte (struct ihex_state * const ihex, const char byte) { uint_fast8_t b = (uint_fast8_t) byte; uint_fast8_t len = ihex->length; uint_fast8_t state = (ihex->flags & IHEX_READ_STATE_MASK); @@ -169,7 +169,7 @@ save_read_state: void ihex_read_bytes (struct ihex_state * restrict ihex, - char * restrict data, + const char * restrict data, ihex_count_t count) { while (count > 0) { ihex_read_byte(ihex, *data++); diff --git a/kk_ihex_read.h b/kk_ihex_read.h index d1f592b..295899b 100644 --- a/kk_ihex_read.h +++ b/kk_ihex_read.h @@ -1,5 +1,5 @@ /* - * kk_ihex_read.h: A simple library for reaing Intel HEX data. See + * kk_ihex_read.h: A simple library for reading Intel HEX data. See * the accompanying kk_ihex_write.h for IHEX write support. * * @@ -53,11 +53,12 @@ void ihex_begin_read(struct ihex_state *ihex); void ihex_read_at_address(struct ihex_state *ihex, ihex_address_t address); -// Read a single byte -void ihex_read_byte(struct ihex_state *ihex, int chr); +// Read a single character +void ihex_read_byte(struct ihex_state *ihex, char chr); // Read `count` bytes from `data` -void ihex_read_bytes(struct ihex_state * restrict ihex, char * restrict data, +void ihex_read_bytes(struct ihex_state * restrict ihex, + const char * restrict data, ihex_count_t count); // End reading (may call `ihex_data_read` if there is data waiting) diff --git a/kk_ihex_write.c b/kk_ihex_write.c index eaa1973..5df56de 100644 --- a/kk_ihex_write.c +++ b/kk_ihex_write.c @@ -213,7 +213,7 @@ ihex_write_byte (struct ihex_state * const ihex, uint8_t byte) { void ihex_write_bytes (struct ihex_state * restrict const ihex, - uint8_t * restrict r, + const uint8_t * restrict r, ihex_count_t count) { while (count > 0) { if (ihex->line_length > ihex->length) { diff --git a/kk_ihex_write.h b/kk_ihex_write.h index 9ba69ea..de6e101 100644 --- a/kk_ihex_write.h +++ b/kk_ihex_write.h @@ -116,7 +116,7 @@ void ihex_write_byte(struct ihex_state *ihex, uint8_t b); // Write `count` bytes from `data` void ihex_write_bytes(struct ihex_state * restrict ihex, - uint8_t * restrict data, + const uint8_t * restrict data, ihex_count_t count); // End writing (flush buffers, write end of file record)