libbase: add const qualifiers.
authorwhitequark <whitequark@whitequark.org>
Sat, 8 Aug 2015 09:16:27 +0000 (12:16 +0300)
committerwhitequark <whitequark@whitequark.org>
Sat, 8 Aug 2015 09:16:27 +0000 (12:16 +0300)
software/include/base/spiflash.h
software/libbase/spiflash.c

index ce5a1d9bbadae4109571aee8549dbbac3721515f..a4ff495ab9717923671be9e9d75887fcfbdd8ab4 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef __SPIFLASH_H
 #define __SPIFLASH_H
 
-void write_to_flash_page(unsigned int addr, unsigned char *c, unsigned int len);
+void write_to_flash_page(unsigned int addr, const unsigned char *c, unsigned int len);
 void erase_flash_sector(unsigned int addr);
-void write_to_flash(unsigned int addr, unsigned char *c, unsigned int len);
+void write_to_flash(unsigned int addr, const unsigned char *c, unsigned int len);
 
 #endif /* __SPIFLASH_H */
index 529fd47b4b2d6e1c05a53d80257d3ee6491807da..31d56a106d7410da69362c33a6d95677965bfb54 100644 (file)
@@ -89,7 +89,7 @@ void erase_flash_sector(unsigned int addr)
     spiflash_bitbang_en_write(0);
 }
 
-void write_to_flash_page(unsigned int addr, unsigned char *c, unsigned int len)
+void write_to_flash_page(unsigned int addr, const unsigned char *c, unsigned int len)
 {
     unsigned int i;
 
@@ -117,7 +117,7 @@ void write_to_flash_page(unsigned int addr, unsigned char *c, unsigned int len)
 
 #define SPIFLASH_PAGE_MASK (SPIFLASH_PAGE_SIZE - 1)
 
-void write_to_flash(unsigned int addr, unsigned char *c, unsigned int len)
+void write_to_flash(unsigned int addr, const unsigned char *c, unsigned int len)
 {
    unsigned int written = 0;