diff options
Diffstat (limited to 'firmware/drivers/rtc/rtc_rx5x348ab.c')
-rw-r--r-- | firmware/drivers/rtc/rtc_rx5x348ab.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/firmware/drivers/rtc/rtc_rx5x348ab.c b/firmware/drivers/rtc/rtc_rx5x348ab.c index 2b4e17c81d..218582c8fa 100644 --- a/firmware/drivers/rtc/rtc_rx5x348ab.c +++ b/firmware/drivers/rtc/rtc_rx5x348ab.c | |||
@@ -36,8 +36,7 @@ void rtc_init(void) | |||
36 | int rtc_read_datetime(unsigned char* buf) | 36 | int rtc_read_datetime(unsigned char* buf) |
37 | { | 37 | { |
38 | char command = ADDR_READ|ADDR_BURST; /* burst read from the start of the time/date reg */ | 38 | char command = ADDR_READ|ADDR_BURST; /* burst read from the start of the time/date reg */ |
39 | spi_block_transfer(SPI_target_RX5X348AB, true, | 39 | spi_block_transfer(SPI_target_RX5X348AB, &command, 1, buf, 7); |
40 | &command, 1, buf, 7); | ||
41 | return 1; | 40 | return 1; |
42 | } | 41 | } |
43 | int rtc_write_datetime(unsigned char* buf) | 42 | int rtc_write_datetime(unsigned char* buf) |
@@ -48,7 +47,6 @@ int rtc_write_datetime(unsigned char* buf) | |||
48 | data[0] = command; | 47 | data[0] = command; |
49 | for (i=1;i<8;i++) | 48 | for (i=1;i<8;i++) |
50 | data[i] = buf[i-1]; | 49 | data[i] = buf[i-1]; |
51 | spi_block_transfer(SPI_target_RX5X348AB, true, | 50 | spi_block_transfer(SPI_target_RX5X348AB, data, 8, NULL, 0); |
52 | data, 8, NULL, 0); | ||
53 | return 1; | 51 | return 1; |
54 | } | 52 | } |