aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple
diff options
context:
space:
mode:
Diffstat (limited to 'libmaple')
-rw-r--r--libmaple/delay.h2
-rw-r--r--libmaple/i2c.c8
-rw-r--r--libmaple/nvic.c2
-rw-r--r--libmaple/util.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/libmaple/delay.h b/libmaple/delay.h
index dd68ec6..6f8b8ba 100644
--- a/libmaple/delay.h
+++ b/libmaple/delay.h
@@ -15,7 +15,7 @@
* @param us Number of microseconds to delay.
*/
static inline void delay_us(uint32 us) {
- us *= DELAY_US_MULT;
+ us *= STM32_DELAY_US_MULT;
/* fudge for function call overhead */
us--;
diff --git a/libmaple/i2c.c b/libmaple/i2c.c
index 8f6967b..e3f3199 100644
--- a/libmaple/i2c.c
+++ b/libmaple/i2c.c
@@ -393,7 +393,7 @@ void i2c_init(i2c_dev *dev) {
* I2C_REMAP: Remap I2C1 to SCL/PB8 SDA/PB9.
*/
void i2c_master_enable(i2c_dev *dev, uint32 flags) {
-#define I2C_CLK (PCLK1/1000000)
+#define I2C_CLK (STM32_PCLK1/1000000)
uint32 ccr = 0;
uint32 trise = 0;
@@ -425,16 +425,16 @@ void i2c_master_enable(i2c_dev *dev, uint32 flags) {
if (flags & I2C_DUTY_16_9) {
/* Tlow/Thigh = 16/9 */
ccr |= I2C_CCR_DUTY;
- ccr |= PCLK1/(400000 * 25);
+ ccr |= STM32_PCLK1/(400000 * 25);
} else {
/* Tlow/Thigh = 2 */
- ccr |= PCLK1/(400000 * 3);
+ ccr |= STM32_PCLK1/(400000 * 3);
}
trise = (300 * (I2C_CLK)/1000) + 1;
} else {
/* Tlow/Thigh = 1 */
- ccr = PCLK1/(100000 * 2);
+ ccr = STM32_PCLK1/(100000 * 2);
trise = I2C_CLK + 1;
}
diff --git a/libmaple/nvic.c b/libmaple/nvic.c
index eed9af8..bbbf13f 100644
--- a/libmaple/nvic.c
+++ b/libmaple/nvic.c
@@ -68,7 +68,7 @@ void nvic_init(uint32 vector_table_address, uint32 offset) {
* Lower priority level for all peripheral interrupts to lowest
* possible.
*/
- for (i = 0; i < NR_INTERRUPTS; i++) {
+ for (i = 0; i < STM32_NR_INTERRUPTS; i++) {
nvic_irq_set_priority((nvic_irq_num)i, 0xF);
}
diff --git a/libmaple/util.c b/libmaple/util.c
index f91b0df..bb56a62 100644
--- a/libmaple/util.c
+++ b/libmaple/util.c
@@ -39,7 +39,7 @@
/* Failed ASSERT()s send out a message using this USART config. */
#ifndef ERROR_USART
#define ERROR_USART USART2
-#define ERROR_USART_CLK_SPEED PCLK1
+#define ERROR_USART_CLK_SPEED STM32_PCLK1
#define ERROR_USART_BAUD 9600
#define ERROR_TX_PORT GPIOA
#define ERROR_TX_PIN 2