forked from len0rd/rockbox
M:Robe 500: RTC is now working, Added some SPI flexibility per end device and modified the interrupt handler for the tsc2100 which should make it more reliable.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21483 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
1910d026b1
commit
19cb444691
6 changed files with 44 additions and 27 deletions
|
@ -36,8 +36,7 @@ void rtc_init(void)
|
|||
int rtc_read_datetime(unsigned char* buf)
|
||||
{
|
||||
char command = ADDR_READ|ADDR_BURST; /* burst read from the start of the time/date reg */
|
||||
spi_block_transfer(SPI_target_RX5X348AB, true,
|
||||
&command, 1, buf, 7);
|
||||
spi_block_transfer(SPI_target_RX5X348AB, &command, 1, buf, 7);
|
||||
return 1;
|
||||
}
|
||||
int rtc_write_datetime(unsigned char* buf)
|
||||
|
@ -48,7 +47,6 @@ int rtc_write_datetime(unsigned char* buf)
|
|||
data[0] = command;
|
||||
for (i=1;i<8;i++)
|
||||
data[i] = buf[i-1];
|
||||
spi_block_transfer(SPI_target_RX5X348AB, true,
|
||||
data, 8, NULL, 0);
|
||||
spi_block_transfer(SPI_target_RX5X348AB, data, 8, NULL, 0);
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue