aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2016-06-30 16:23:29 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2016-06-30 16:23:29 +0900
commita2a29146a6d7327f8e159fedb6060b77cff46021 (patch)
tree7718a02b3ee9f8a9c8407374f90fecd8839c8d9f
parente7bd234a0daeff4c16ef80f1529aa1f9dd500697 (diff)
const pointer cleanup
-rw-r--r--chopstx.c16
-rw-r--r--example-fsm-55/debian-logo.c6
-rw-r--r--example-fsm-55/hh.c6
-rw-r--r--example-fsm-55/hiroshi-ayumi.c4
-rw-r--r--mcu/clk_gpio_init-stm32.c14
-rw-r--r--mcu/stm32f103.h14
-rw-r--r--mcu/sys-stm32f0.c2
-rw-r--r--mcu/sys-stm32f103.c2
-rw-r--r--mcu/usb-mkl27z.c2
9 files changed, 33 insertions, 33 deletions
diff --git a/chopstx.c b/chopstx.c
index 625f889..4aa9d75 100644
--- a/chopstx.c
+++ b/chopstx.c
@@ -104,9 +104,9 @@
* System tick
*/
/* SysTick registers. */
-static volatile uint32_t *const SYST_CSR = (uint32_t *const)0xE000E010;
-static volatile uint32_t *const SYST_RVR = (uint32_t *const)0xE000E014;
-static volatile uint32_t *const SYST_CVR = (uint32_t *const)0xE000E018;
+static volatile uint32_t *const SYST_CSR = (uint32_t *)0xE000E010;
+static volatile uint32_t *const SYST_RVR = (uint32_t *)0xE000E014;
+static volatile uint32_t *const SYST_CVR = (uint32_t *)0xE000E018;
static void
chx_systick_reset (void)
@@ -158,7 +158,7 @@ struct NVIC {
volatile uint32_t IPR[60];
};
-static struct NVIC *const NVIC = (struct NVIC *const)0xE000E100;
+static struct NVIC *const NVIC = (struct NVIC *)0xE000E100;
#define NVIC_ISER(n) (NVIC->ISER[n >> 5])
#define NVIC_ICER(n) (NVIC->ICER[n >> 5])
#define NVIC_ICPR(n) (NVIC->ICPR[n >> 5])
@@ -192,12 +192,12 @@ chx_set_intr_prio (uint8_t n)
| (CPU_EXCEPTION_PRIORITY_INTERRUPT << sh);
}
-static volatile uint32_t *const ICSR = (uint32_t *const)0xE000ED04;
+static volatile uint32_t *const ICSR = (uint32_t *)0xE000ED04;
/* Priority control. */
-static uint32_t *const AIRCR = (uint32_t *const)0xE000ED0C;
-static uint32_t *const SHPR2 = (uint32_t *const)0xE000ED1C;
-static uint32_t *const SHPR3 = (uint32_t *const)0xE000ED20;
+static uint32_t *const AIRCR = (uint32_t *)0xE000ED0C;
+static uint32_t *const SHPR2 = (uint32_t *)0xE000ED1C;
+static uint32_t *const SHPR3 = (uint32_t *)0xE000ED20;
static void
chx_prio_init (void)
diff --git a/example-fsm-55/debian-logo.c b/example-fsm-55/debian-logo.c
index a3f78fd..e96fb75 100644
--- a/example-fsm-55/debian-logo.c
+++ b/example-fsm-55/debian-logo.c
@@ -34,8 +34,8 @@ struct GPIO {
#define GPIOF_BASE (AHB2PERIPH_BASE + 0x1400)
#define GPIOF ((struct GPIO *) GPIOF_BASE)
-static struct GPIO *const GPIO_LED = ((struct GPIO *const) GPIO_LED_BASE);
-static struct GPIO *const GPIO_OTHER = ((struct GPIO *const) GPIO_OTHER_BASE);
+static struct GPIO *const GPIO_LED = ((struct GPIO *)GPIO_LED_BASE);
+static struct GPIO *const GPIO_OTHER = ((struct GPIO *)GPIO_OTHER_BASE);
static chopstx_mutex_t mtx;
static chopstx_cond_t cnd0, cnd1;
@@ -450,7 +450,7 @@ struct SCB
#define SCS_BASE (0xE000E000)
#define SCB_BASE (SCS_BASE + 0x0D00)
-static struct SCB *const SCB = ((struct SCB *const) SCB_BASE);
+static struct SCB *const SCB = ((struct SCB *)SCB_BASE);
#define SCB_SCR_SLEEPDEEP (1 << 2)
diff --git a/example-fsm-55/hh.c b/example-fsm-55/hh.c
index 1567c41..8575383 100644
--- a/example-fsm-55/hh.c
+++ b/example-fsm-55/hh.c
@@ -34,8 +34,8 @@ struct GPIO {
#define GPIOF_BASE (AHB2PERIPH_BASE + 0x1400)
#define GPIOF ((struct GPIO *) GPIOF_BASE)
-static struct GPIO *const GPIO_LED = ((struct GPIO *const) GPIO_LED_BASE);
-static struct GPIO *const GPIO_OTHER = ((struct GPIO *const) GPIO_OTHER_BASE);
+static struct GPIO *const GPIO_LED = ((struct GPIO *)GPIO_LED_BASE);
+static struct GPIO *const GPIO_OTHER = ((struct GPIO *)GPIO_OTHER_BASE);
static chopstx_mutex_t mtx;
static chopstx_cond_t cnd0, cnd1;
@@ -438,7 +438,7 @@ struct SCB
#define SCS_BASE (0xE000E000)
#define SCB_BASE (SCS_BASE + 0x0D00)
-static struct SCB *const SCB = ((struct SCB *const) SCB_BASE);
+static struct SCB *const SCB = ((struct SCB *)SCB_BASE);
#define SCB_SCR_SLEEPDEEP (1 << 2)
diff --git a/example-fsm-55/hiroshi-ayumi.c b/example-fsm-55/hiroshi-ayumi.c
index a398689..d465208 100644
--- a/example-fsm-55/hiroshi-ayumi.c
+++ b/example-fsm-55/hiroshi-ayumi.c
@@ -35,8 +35,8 @@ struct GPIO {
#define GPIO_SPEAKER_PIN 1
-static struct GPIO *const GPIO_LED = ((struct GPIO *const) GPIO_LED_BASE);
-static struct GPIO *const GPIO_OTHER = ((struct GPIO *const) GPIO_OTHER_BASE);
+static struct GPIO *const GPIO_LED = ((struct GPIO *)GPIO_LED_BASE);
+static struct GPIO *const GPIO_OTHER = ((struct GPIO *)GPIO_OTHER_BASE);
static chopstx_mutex_t mtx;
static chopstx_cond_t cnd;
diff --git a/mcu/clk_gpio_init-stm32.c b/mcu/clk_gpio_init-stm32.c
index b5d6fe8..08bd59b 100644
--- a/mcu/clk_gpio_init-stm32.c
+++ b/mcu/clk_gpio_init-stm32.c
@@ -100,7 +100,7 @@ struct RCC {
};
#define RCC_BASE (AHBPERIPH_BASE + 0x1000)
-static struct RCC *const RCC = ((struct RCC *const)RCC_BASE);
+static struct RCC *const RCC = (struct RCC *)RCC_BASE;
#define RCC_APB1ENR_USBEN 0x00800000
#define RCC_APB1RSTR_USBRST 0x00800000
@@ -163,7 +163,7 @@ struct SYSCFG {
#define SYSCFG_CFGR1_MEM_MODE 0x03
#define SYSCFG_BASE (APBPERIPH_BASE + 0x00010000)
-static struct SYSCFG *const SYSCFG = ((struct SYSCFG *const) SYSCFG_BASE);
+static struct SYSCFG *const SYSCFG = (struct SYSCFG *)SYSCFG_BASE;
#endif
struct FLASH {
@@ -179,7 +179,7 @@ struct FLASH {
};
#define FLASH_R_BASE (AHBPERIPH_BASE + 0x2000)
-static struct FLASH *const FLASH = ((struct FLASH *const) FLASH_R_BASE);
+static struct FLASH *const FLASH = (struct FLASH *)FLASH_R_BASE;
static void __attribute__((used))
clock_init (void)
@@ -279,7 +279,7 @@ struct AFIO
};
#define AFIO_BASE 0x40010000
-static struct AFIO *const AFIO = (struct AFIO *const)AFIO_BASE;
+static struct AFIO *const AFIO = (struct AFIO *)AFIO_BASE;
#define AFIO_MAPR_TIM3_REMAP_PARTIALREMAP 0x00000800
#define AFIO_MAPR_SWJ_CFG_DISABLE 0x04000000
@@ -308,12 +308,12 @@ struct GPIO {
#define GPIOE ((struct GPIO *) GPIOE_BASE)
#endif
-static struct GPIO *const GPIO_LED = ((struct GPIO *const) GPIO_LED_BASE);
+static struct GPIO *const GPIO_LED = (struct GPIO *)GPIO_LED_BASE;
#ifdef GPIO_USB_BASE
-static struct GPIO *const GPIO_USB = ((struct GPIO *const) GPIO_USB_BASE);
+static struct GPIO *const GPIO_USB = (struct GPIO *)GPIO_USB_BASE;
#endif
#ifdef GPIO_OTHER_BASE
-static struct GPIO *const GPIO_OTHER = ((struct GPIO *const) GPIO_OTHER_BASE);
+static struct GPIO *const GPIO_OTHER = (struct GPIO *)GPIO_OTHER_BASE;
#endif
static void __attribute__((used))
diff --git a/mcu/stm32f103.h b/mcu/stm32f103.h
index a4ecaa1..bfc876e 100644
--- a/mcu/stm32f103.h
+++ b/mcu/stm32f103.h
@@ -19,7 +19,7 @@ struct RCC {
};
#define RCC_BASE (AHBPERIPH_BASE + 0x1000)
-static struct RCC *const RCC = ((struct RCC *const)RCC_BASE);
+static struct RCC *const RCC = (struct RCC *)RCC_BASE;
#define RCC_AHBENR_DMA1EN 0x00000001
#define RCC_AHBENR_CRCEN 0x00000040
@@ -38,7 +38,7 @@ struct CRC {
};
#define CRC_BASE (AHBPERIPH_BASE + 0x3000)
-static struct CRC *const CRC = ((struct CRC *const)CRC_BASE);
+static struct CRC *const CRC = (struct CRC *)CRC_BASE;
struct ADC {
@@ -67,8 +67,8 @@ struct ADC {
#define ADC1_BASE (APB2PERIPH_BASE + 0x2400)
#define ADC2_BASE (APB2PERIPH_BASE + 0x2800)
-static struct ADC *const ADC1 = (struct ADC *const)ADC1_BASE;
-static struct ADC *const ADC2 = (struct ADC *const)ADC2_BASE;
+static struct ADC *const ADC1 = (struct ADC *)ADC1_BASE;
+static struct ADC *const ADC2 = (struct ADC *)ADC2_BASE;
#define ADC_CR1_DUALMOD_0 0x00010000
#define ADC_CR1_DUALMOD_1 0x00020000
@@ -167,11 +167,11 @@ struct DMA {
#define DMA_ISR_TEIF7 0x08000000
#define DMA1_BASE (AHBPERIPH_BASE + 0x0000)
-static struct DMA *const DMA1 = (struct DMA *const)DMA1_BASE;
+static struct DMA *const DMA1 = (struct DMA *)DMA1_BASE;
#define DMA1_Channel1_BASE (AHBPERIPH_BASE + 0x0008)
static struct DMA_Channel *const DMA1_Channel1 =
- (struct DMA_Channel *const)DMA1_Channel1_BASE;
+ (struct DMA_Channel *)DMA1_Channel1_BASE;
/* System Control Block */
struct SCB
@@ -201,4 +201,4 @@ struct SCB
#define SCS_BASE 0xE000E000
#define SCB_BASE (SCS_BASE + 0x0D00)
-static struct SCB *const SCB = (struct SCB *const)SCB_BASE;
+static struct SCB *const SCB = (struct SCB *)SCB_BASE;
diff --git a/mcu/sys-stm32f0.c b/mcu/sys-stm32f0.c
index f811b97..f7db06c 100644
--- a/mcu/sys-stm32f0.c
+++ b/mcu/sys-stm32f0.c
@@ -323,7 +323,7 @@ struct SCB
#define SCS_BASE (0xE000E000)
#define SCB_BASE (SCS_BASE + 0x0D00)
-static struct SCB *const SCB = ((struct SCB *const) SCB_BASE);
+static struct SCB *const SCB = (struct SCB *)SCB_BASE;
#define SYSRESETREQ 0x04
static void
diff --git a/mcu/sys-stm32f103.c b/mcu/sys-stm32f103.c
index dc1cfa1..05e1f2f 100644
--- a/mcu/sys-stm32f103.c
+++ b/mcu/sys-stm32f103.c
@@ -316,7 +316,7 @@ struct SCB
#define SCS_BASE (0xE000E000)
#define SCB_BASE (SCS_BASE + 0x0D00)
-static struct SCB *const SCB = ((struct SCB *const) SCB_BASE);
+static struct SCB *const SCB = (struct SCB *)SCB_BASE;
#define SYSRESETREQ 0x04
static void
diff --git a/mcu/usb-mkl27z.c b/mcu/usb-mkl27z.c
index 2d35385..72cc175 100644
--- a/mcu/usb-mkl27z.c
+++ b/mcu/usb-mkl27z.c
@@ -50,7 +50,7 @@ struct USB_CONF {
uint8_t rsvd2[3]; /* */
volatile uint8_t ADDINFO; /* Peripheral Additional Info register */
};
-static struct USB_CONF *const USB_CONF = (struct USB_CONF *) 0x40072000;
+static struct USB_CONF *const USB_CONF = (struct USB_CONF *)0x40072000;
struct USB_CTRL0 {
volatile uint8_t OTGCTL; /* OTG Control register */