mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2026-03-14 21:19:43 +01:00
parent
bb5a2a3906
commit
5a427fbf1f
1 changed files with 3 additions and 3 deletions
|
|
@ -135,9 +135,9 @@ irq_handler_t irq_get_exclusive_handler(uint num) {
|
|||
static uint16_t make_branch(uint16_t *from, void *to) {
|
||||
uint32_t ui_from = (uint32_t)from;
|
||||
uint32_t ui_to = (uint32_t)to;
|
||||
uint32_t delta = (ui_to - ui_from - 4) / 2;
|
||||
assert(!(delta >> 11u));
|
||||
return (uint16_t)(0xe000 | (delta & 0x7ff));
|
||||
int32_t delta = (int32_t)(ui_to - ui_from - 4);
|
||||
assert(delta >= -2048 && delta <= 2046 && !(delta & 1));
|
||||
return (uint16_t)(0xe000 | ((delta >> 1) & 0x7ff));
|
||||
}
|
||||
|
||||
static void insert_branch_and_link(uint16_t *from, void *to) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue