Skip to content

Commit

Permalink
Fix thumb16 for __ARM_ASM_SYNTAX_UNIFIED__ again
Browse files Browse the repository at this point in the history
  • Loading branch information
felixjones committed Dec 10, 2023
1 parent 03c0fdc commit cfe98b1
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions source/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,14 @@ static void rtc_cmd_arg(const unsigned int cmd, unsigned int data, unsigned int

int wait = (TIMEOUT_CYCLES_WAIT_AFTER_WRITE_PER_BYTE * 7 + 11 + 6) / 12;
__asm__ volatile (
"L1%=:" "\n\t"
"subs %[wait], %[wait], #1" "\n\t"
"L1%=:" "\n\t"
#if __ARM_ASM_SYNTAX_UNIFIED__ == 1
"subs %[wait], %[wait], #1" "\n\t"
#else
"sub %[wait], #1" "\n\t"
#endif
"bne L1%="
:: [wait]"r"(wait)
: [wait]"+r"(wait)
);
}

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

int wait = (TIMEOUT_CYCLES_WAIT_AFTER_WRITE_PER_BYTE * 7 + 11 + 6) / 12;
__asm__ volatile (
"L1%=:" "\n\t"
"subs %[wait], %[wait], #1" "\n\t"
"L1%=:" "\n\t"
#if __ARM_ASM_SYNTAX_UNIFIED__ == 1
"subs %[wait], %[wait], #1" "\n\t"
#else
"sub %[wait], #1" "\n\t"
#endif
"bne L1%="
:: [wait]"r"(wait)
: [wait]"+r"(wait)
);
}

Expand Down

0 comments on commit cfe98b1

Please sign in to comment.