Skip to content

Commit cfe98b1

Browse files
committed
Fix thumb16 for __ARM_ASM_SYNTAX_UNIFIED__ again
1 parent 03c0fdc commit cfe98b1

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

source/rtc.c

+14-6
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,14 @@ static void rtc_cmd_arg(const unsigned int cmd, unsigned int data, unsigned int
145145

146146
int wait = (TIMEOUT_CYCLES_WAIT_AFTER_WRITE_PER_BYTE * 7 + 11 + 6) / 12;
147147
__asm__ volatile (
148-
"L1%=:" "\n\t"
149-
"subs %[wait], %[wait], #1" "\n\t"
148+
"L1%=:" "\n\t"
149+
#if __ARM_ASM_SYNTAX_UNIFIED__ == 1
150+
"subs %[wait], %[wait], #1" "\n\t"
151+
#else
152+
"sub %[wait], #1" "\n\t"
153+
#endif
150154
"bne L1%="
151-
:: [wait]"r"(wait)
155+
: [wait]"+r"(wait)
152156
);
153157
}
154158

@@ -163,10 +167,14 @@ static void rtc_cmd_arg_datetime(unsigned int cmd, __agbabi_datetime_t datetime,
163167

164168
int wait = (TIMEOUT_CYCLES_WAIT_AFTER_WRITE_PER_BYTE * 7 + 11 + 6) / 12;
165169
__asm__ volatile (
166-
"L1%=:" "\n\t"
167-
"subs %[wait], %[wait], #1" "\n\t"
170+
"L1%=:" "\n\t"
171+
#if __ARM_ASM_SYNTAX_UNIFIED__ == 1
172+
"subs %[wait], %[wait], #1" "\n\t"
173+
#else
174+
"sub %[wait], #1" "\n\t"
175+
#endif
168176
"bne L1%="
169-
:: [wait]"r"(wait)
177+
: [wait]"+r"(wait)
170178
);
171179
}
172180

0 commit comments

Comments
 (0)