aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/fx2/common/spi.c
diff options
context:
space:
mode:
authorMarcus Müller <marcus.mueller@ettus.com>2017-01-16 15:54:57 +0100
committerMartin Braun <martin.braun@ettus.com>2017-06-29 15:53:15 -0700
commitd9bcf00f69313b6dd42346d6af340a1a9874ba9f (patch)
tree62185d7ea2c20952d60cf8f6a558866ecf1d54bf /firmware/fx2/common/spi.c
parentc77bd0c46a598d5e69b179d76a3df6091e982129 (diff)
downloaduhd-d9bcf00f69313b6dd42346d6af340a1a9874ba9f.tar.gz
uhd-d9bcf00f69313b6dd42346d6af340a1a9874ba9f.tar.bz2
uhd-d9bcf00f69313b6dd42346d6af340a1a9874ba9f.zip
made FX2 EEPROMS and firmware build with modern SDCC 3.6
Diffstat (limited to 'firmware/fx2/common/spi.c')
-rw-r--r--firmware/fx2/common/spi.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/firmware/fx2/common/spi.c b/firmware/fx2/common/spi.c
index 04a1d8477..6f62c91ff 100644
--- a/firmware/fx2/common/spi.c
+++ b/firmware/fx2/common/spi.c
@@ -98,17 +98,17 @@ static void
write_byte_msb (unsigned char v);
static void
-write_bytes_msb (const xdata unsigned char *buf, unsigned char len);
+write_bytes_msb (const __xdata unsigned char *buf, unsigned char len);
static void
-read_bytes_msb (xdata unsigned char *buf, unsigned char len);
+read_bytes_msb (__xdata unsigned char *buf, unsigned char len);
// returns non-zero if successful, else 0
unsigned char
spi_read (unsigned char header_hi, unsigned char header_lo,
unsigned char enables, unsigned char format,
- xdata unsigned char *buf, unsigned char len)
+ __xdata unsigned char *buf, unsigned char len)
{
if (count_bits8 (enables) > 1)
return 0; // error, too many enables set
@@ -165,7 +165,7 @@ spi_read (unsigned char header_hi, unsigned char header_lo,
unsigned char
spi_write (unsigned char header_hi, unsigned char header_lo,
unsigned char enables, unsigned char format,
- const xdata unsigned char *buf, unsigned char len)
+ const __xdata unsigned char *buf, unsigned char len)
{
setup_enables (enables);
@@ -261,7 +261,7 @@ write_byte_msb (unsigned char v)
}
static void
-write_bytes_msb (const xdata unsigned char *buf, unsigned char len)
+write_bytes_msb (const __xdata unsigned char *buf, unsigned char len)
{
while (len-- != 0){
write_byte_msb (*buf++);
@@ -320,9 +320,9 @@ read_byte_msb (void)
}
#else
static unsigned char
-read_byte_msb (void) _naked
+read_byte_msb (void) __naked
{
- _asm
+ __asm
clr a
setb _bitS_CLK
@@ -367,12 +367,12 @@ read_byte_msb (void) _naked
mov dpl,a
ret
- _endasm;
+ __endasm;
}
#endif
static void
-read_bytes_msb (xdata unsigned char *buf, unsigned char len)
+read_bytes_msb (__xdata unsigned char *buf, unsigned char len)
{
while (len-- != 0){
*buf++ = read_byte_msb ();