forked from ExpressLRS/ExpressLRS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bootloader updated to v0.5.3 (ExpressLRS#260)
Bootloader updated to v0.5.3 * GPIO handling enhanced * UART pinout config per pio env * 2 different UART configs can be used for R9M * Xmodem + STK500 dual boot option * Fixes ELRS FW bootup time crash
- Loading branch information
Showing
32 changed files
with
827 additions
and
448 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// Definitions for irq enable/disable on ARM Cortex-M processors | ||
// | ||
// Copyright (C) 2017-2018 Kevin O'Connor <kevin@koconnor.net> | ||
// https://github.com/KevinOConnor/klipper | ||
// | ||
// This file may be distributed under the terms of the GNU GPLv3 license. | ||
|
||
#include "irq.h" // irqstatus_t | ||
|
||
void irq_disable(void) | ||
{ | ||
asm volatile("cpsid i" :: | ||
: "memory"); | ||
} | ||
|
||
void irq_enable(void) | ||
{ | ||
asm volatile("cpsie i" :: | ||
: "memory"); | ||
} | ||
|
||
irqstatus_t | ||
irq_save(void) | ||
{ | ||
irqstatus_t flag; | ||
asm volatile("mrs %0, primask" | ||
: "=r"(flag)::"memory"); | ||
irq_disable(); | ||
return flag; | ||
} | ||
|
||
void irq_restore(irqstatus_t flag) | ||
{ | ||
asm volatile("msr primask, %0" ::"r"(flag) | ||
: "memory"); | ||
} | ||
|
||
void irq_wait(void) | ||
{ | ||
asm volatile("cpsie i\n wfi\n cpsid i\n" :: | ||
: "memory"); | ||
} | ||
|
||
void irq_poll(void) | ||
{ | ||
} | ||
|
||
// Clear the active irq if a shutdown happened in an irq handler | ||
void clear_active_irq(void) | ||
{ | ||
uint32_t psr; | ||
asm volatile("mrs %0, psr" | ||
: "=r"(psr)); | ||
if (!(psr & 0x1ff)) | ||
// Shutdown did not occur in an irq - nothing to do. | ||
return; | ||
// Clear active irq status | ||
psr = 1 << 24; // T-bit | ||
uint32_t temp; | ||
asm volatile( | ||
" push { %1 }\n" | ||
" adr %0, 1f\n" | ||
" push { %0 }\n" | ||
" push { r0, r1, r2, r3, r4, lr }\n" | ||
" bx %2\n" | ||
".balign 4\n" | ||
"1:\n" | ||
: "=&r"(temp) | ||
: "r"(psr), "r"(0xfffffff9) | ||
: "r12", "cc"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Definitions for irq enable/disable on ARM Cortex-M processors | ||
// | ||
// Copyright (C) 2019 Kevin O'Connor <kevin@koconnor.net> | ||
// https://github.com/KevinOConnor/klipper | ||
// | ||
// This file may be distributed under the terms of the GNU GPLv3 license. | ||
|
||
#ifndef __GENERIC_IRQ_H | ||
#define __GENERIC_IRQ_H | ||
|
||
#include <stdint.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
typedef unsigned long irqstatus_t; | ||
|
||
void irq_disable(void); | ||
void irq_enable(void); | ||
irqstatus_t irq_save(void); | ||
void irq_restore(irqstatus_t flag); | ||
void irq_wait(void); | ||
void irq_poll(void); | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // irq.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.