fix: stack, ldscript

This commit is contained in:
2024-12-07 04:03:16 +06:00
parent 9e48697f3d
commit a724a940a6
4 changed files with 8 additions and 21 deletions

View File

@@ -904,22 +904,13 @@ typedef struct {
#define PAD_DRV_STRENGTH_6 (0x00000006 << 9)
#define PAD_DRV_STRENGTH_7 (0x00000007 << 9)
static inline void PINMUX_Config_BL(uint32_t pin, uint32_t func) {
static inline void PINMUX_Config(uint32_t pin, uint32_t func) {
volatile uint32_t *reg = &PERI_ON->GPIO_PINMUX_CTRL[pin >> 1];
uint32_t shift = (pin & 1) << 4;
uint32_t mask = 0xFFFF << shift;
*reg = (*reg & ~mask) | (func << shift);
}
static inline void PINMUX_Config(uint32_t pin, uint32_t func) {
volatile uint32_t *reg = &PERI_ON->GPIO_PINMUX_CTRL[pin >> 1];
if (pin & 1) {
*reg = (*reg & 0x0000FFFF) | (func << 16);
} else {
*reg = (*reg & 0xFFFF0000) | func;
}
}
static inline void PINMUX_ConfigPadPull(uint8_t pin, uint8_t pull_type) {
uint32_t reg_index = pin >> 1;
uint32_t bit_pos = (pin & 1) << 4;