Skip to content

Commit cf3a9e0

Browse files
author
whitequark
committedAug 8, 2015
libbase: add const qualifiers.
1 parent 1b34f48 commit cf3a9e0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

Diff for: ‎software/include/base/spiflash.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef __SPIFLASH_H
22
#define __SPIFLASH_H
33

4-
void write_to_flash_page(unsigned int addr, unsigned char *c, unsigned int len);
4+
void write_to_flash_page(unsigned int addr, const unsigned char *c, unsigned int len);
55
void erase_flash_sector(unsigned int addr);
6-
void write_to_flash(unsigned int addr, unsigned char *c, unsigned int len);
6+
void write_to_flash(unsigned int addr, const unsigned char *c, unsigned int len);
77

88
#endif /* __SPIFLASH_H */

Diff for: ‎software/libbase/spiflash.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void erase_flash_sector(unsigned int addr)
8989
spiflash_bitbang_en_write(0);
9090
}
9191

92-
void write_to_flash_page(unsigned int addr, unsigned char *c, unsigned int len)
92+
void write_to_flash_page(unsigned int addr, const unsigned char *c, unsigned int len)
9393
{
9494
unsigned int i;
9595

@@ -117,7 +117,7 @@ void write_to_flash_page(unsigned int addr, unsigned char *c, unsigned int len)
117117

118118
#define SPIFLASH_PAGE_MASK (SPIFLASH_PAGE_SIZE - 1)
119119

120-
void write_to_flash(unsigned int addr, unsigned char *c, unsigned int len)
120+
void write_to_flash(unsigned int addr, const unsigned char *c, unsigned int len)
121121
{
122122
unsigned int written = 0;
123123

0 commit comments

Comments
 (0)
Please sign in to comment.