DS: Fix RTC not outputting on LOW

This commit is contained in:
Vicki Pfau 2017-03-13 16:29:45 -07:00
parent 2b70e1714a
commit 6d4236bd29
1 changed files with 6 additions and 2 deletions

View File

@ -885,8 +885,12 @@ uint16_t DSWriteRTC(struct DS* ds, DSRegisterRTC value) {
break;
case 2:
if (!DSRegisterRTCIsClock(value)) {
ds->rtc.bits &= ~(1 << ds->rtc.bitsRead);
ds->rtc.bits |= DSRegisterRTCGetData(value) << ds->rtc.bitsRead;
if (DSRegisterRTCIsDataDirection(value)) {
ds->rtc.bits &= ~(1 << ds->rtc.bitsRead);
ds->rtc.bits |= DSRegisterRTCGetData(value) << ds->rtc.bitsRead;
} else {
value = DSRegisterRTCSetData(value, GBARTCOutput(&ds->rtc));
}
} else {
if (DSRegisterRTCIsSelect(value)) {
// GPIO direction should always != reading