From b2f6fe00dac2da5497b493d691057c7eb0337f85 Mon Sep 17 00:00:00 2001 From: justinkim Date: Thu, 27 Apr 2017 08:34:33 +0900 Subject: [PATCH] Modified coding style of mbed. - deleted dead code - deleted test code --- .../W7500x_Peripheral_Library/W7500x_adc.c | 8 ++++---- targets/TARGET_WIZNET/TARGET_W7500x/analogin_api.c | 10 ++-------- targets/TARGET_WIZNET/TARGET_W7500x/gpio_irq_api.c | 6 ------ targets/TARGET_WIZNET/TARGET_W7500x/pinmap.c | 2 +- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/targets/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_adc.c b/targets/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_adc.c index dccee64758..aea4bba160 100644 --- a/targets/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_adc.c +++ b/targets/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_adc.c @@ -36,21 +36,21 @@ uint8_t ADC_IsInterrupt (void) void ADC_InterruptClear (void) { - ADC->ADC_INT = ADC_INTCLEAR; + ADC->ADC_INT = ADC_INTCLEAR; } void ADC_Init (void) { - // ADC_CLK on + // ADC_CLK on ADC_PowerDownEnable(ENABLE); - ADC_PowerDownEnable(DISABLE); + ADC_PowerDownEnable(DISABLE); //ADC_ChannelSelect(num); } void ADC_DeInit (void) { // ADC_CLK off - ADC_PowerDownEnable(ENABLE); + ADC_PowerDownEnable(ENABLE); ADC_InterruptMask(DISABLE); } diff --git a/targets/TARGET_WIZNET/TARGET_W7500x/analogin_api.c b/targets/TARGET_WIZNET/TARGET_W7500x/analogin_api.c index fef78ac2dc..14fd15d73b 100644 --- a/targets/TARGET_WIZNET/TARGET_W7500x/analogin_api.c +++ b/targets/TARGET_WIZNET/TARGET_W7500x/analogin_api.c @@ -42,8 +42,6 @@ ADC_TypeDef * AdcHandle; -static int adc_inited = 0; - void analogin_init(analogin_t *obj, PinName pin) { // Get the peripheral name from the pin and assign it to the object @@ -57,12 +55,8 @@ void analogin_init(analogin_t *obj, PinName pin) // Save pin number for the read function obj->pin = pin; - // The ADC initialization is done once - //if (adc_inited == 0) { - adc_inited = 1; - - ADC_Init(); - //} + // The ADC initialization + ADC_Init(); } static inline uint16_t adc_read(analogin_t *obj) diff --git a/targets/TARGET_WIZNET/TARGET_W7500x/gpio_irq_api.c b/targets/TARGET_WIZNET/TARGET_W7500x/gpio_irq_api.c index badb1e95e8..d828460fdb 100644 --- a/targets/TARGET_WIZNET/TARGET_W7500x/gpio_irq_api.c +++ b/targets/TARGET_WIZNET/TARGET_W7500x/gpio_irq_api.c @@ -43,7 +43,6 @@ static gpio_irq_handler irq_handler; static uint32_t channel_ids[4][16]; -uint32_t test_tmp = 0; #ifdef __cplusplus extern "C"{ @@ -54,25 +53,21 @@ void PORT0_Handler(void) { NVIC_ClearPendingIRQ(PORT0_IRQn); port_generic_handler(GPIOA, 0); - test_tmp++; } void PORT1_Handler(void) { port_generic_handler(GPIOB, 1); - test_tmp++; } void PORT2_Handler(void) { port_generic_handler(GPIOC, 2); - test_tmp++; } void PORT3_Handler(void) { port_generic_handler(GPIOD, 3); - test_tmp++; } void port_generic_handler(GPIO_TypeDef* GPIOx, uint32_t port_num) @@ -119,7 +114,6 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32 else obj->irq_n = PORT3_IRQn; - obj->event = EDGE_NONE; obj->pin = pin; // Enable EXTI interrupt diff --git a/targets/TARGET_WIZNET/TARGET_W7500x/pinmap.c b/targets/TARGET_WIZNET/TARGET_W7500x/pinmap.c index abf655fa1a..4b2929f252 100644 --- a/targets/TARGET_WIZNET/TARGET_W7500x/pinmap.c +++ b/targets/TARGET_WIZNET/TARGET_W7500x/pinmap.c @@ -117,7 +117,7 @@ void pin_mode(PinName pin, PinMode pupd) uint32_t port_num = WIZ_PORT(pin); uint32_t pin_num = WIZ_PIN_NUM(pin); - switch(port_num) { + switch(port_num) { case PortA: if(pupd != 0) {