Fix bug in clock manager and remove DMA sampling from ADC code. Will be rewritten in a different way

This commit is contained in:
2020-02-03 19:40:59 +01:00
parent 5f9bc29701
commit 1e678c3ce8
5 changed files with 32 additions and 68 deletions

View File

@@ -10,7 +10,7 @@
#define RCC_ENABLE_MANAGER_STATIC 1U
#if RCC_ENABLE_MANAGER_STATIC
#define RCC_ENABLE_MANAGER_COUNT 20U
#define RCC_ENABLE_MANAGER_COUNT 30U
#else
#error "RCC Enable Manager not yet implemented with dynamic memory"
#endif
@@ -28,7 +28,7 @@
*
* @return 0 if successful
*/
int rcc_manager_enable_clock(uint32_t *rcc_enable_register, uint8_t bit_no);
int rcc_manager_enable_clock(volatile uint32_t *rcc_enable_register, uint8_t bit_no);
/**
* @brief Disable clock for peripheral and decrement the enaböe-counter of that bit.
@@ -42,7 +42,7 @@ int rcc_manager_enable_clock(uint32_t *rcc_enable_register, uint8_t bit_no);
* @param bit_no Bit number (0 to 31) of the bit to disable
* @return 0 if successful
*/
int rcc_manager_disable_clock(uint32_t *rcc_enable_register, uint8_t bit_no);
int rcc_manager_disable_clock(volatile uint32_t *rcc_enable_register, uint8_t bit_no);
#endif /* __CLOCK_ENABLE_MANAGER_H__ */

View File

@@ -8,7 +8,7 @@
#define SETAF(PORT,PIN,AF) PORT->AFR[(PIN < 8 ? 0 : 1)] |= AF << ((PIN < 8 ? PIN : (PIN - 8)) * 4)
#define ANALOG(pin) (0x03 << (pin * 2))
#define BIOTMASK_TO_BITNO(x) (x&0x1?0:x&0x2?1:x&0x4?2:x&0x8?3: \
#define BITMASK_TO_BITNO(x) (x&0x1?0:x&0x2?1:x&0x4?2:x&0x8?3: \
x&0x10?4:x&0x20?5:x&0x40?6:x&0x80?7: \
x&0x100?8:x&0x200?9:x&0x400?10:x&0x800?11: \
x&0x1000?12:x&0x2000?13:x&0x4000?14:x&0x8000?15: \