Skip to content

Commit fe4edae

Browse files
committed
Modified coding style of mbed.
- deleted dead code - deleted test code
1 parent 4fa76dc commit fe4edae

File tree

4 files changed

+7
-19
lines changed

4 files changed

+7
-19
lines changed

targets/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_adc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ uint8_t ADC_IsInterrupt (void)
3636

3737
void ADC_InterruptClear (void)
3838
{
39-
ADC->ADC_INT = ADC_INTCLEAR;
39+
ADC->ADC_INT = ADC_INTCLEAR;
4040
}
4141

4242
void ADC_Init (void)
4343
{
44-
// ADC_CLK on
44+
// ADC_CLK on
4545
ADC_PowerDownEnable(ENABLE);
46-
ADC_PowerDownEnable(DISABLE);
46+
ADC_PowerDownEnable(DISABLE);
4747
//ADC_ChannelSelect(num);
4848
}
4949

5050
void ADC_DeInit (void)
5151
{
5252
// ADC_CLK off
53-
ADC_PowerDownEnable(ENABLE);
53+
ADC_PowerDownEnable(ENABLE);
5454
ADC_InterruptMask(DISABLE);
5555
}
5656

targets/TARGET_WIZNET/TARGET_W7500x/analogin_api.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242

4343
ADC_TypeDef * AdcHandle;
4444

45-
static int adc_inited = 0;
46-
4745
void analogin_init(analogin_t *obj, PinName pin)
4846
{
4947
// 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)
5755
// Save pin number for the read function
5856
obj->pin = pin;
5957

60-
// The ADC initialization is done once
61-
//if (adc_inited == 0) {
62-
adc_inited = 1;
63-
64-
ADC_Init();
65-
//}
58+
// The ADC initialization
59+
ADC_Init();
6660
}
6761

6862
static inline uint16_t adc_read(analogin_t *obj)

targets/TARGET_WIZNET/TARGET_W7500x/gpio_irq_api.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ static gpio_irq_handler irq_handler;
4343

4444
static uint32_t channel_ids[4][16];
4545

46-
uint32_t test_tmp = 0;
4746

4847
#ifdef __cplusplus
4948
extern "C"{
@@ -54,25 +53,21 @@ void PORT0_Handler(void)
5453
{
5554
NVIC_ClearPendingIRQ(PORT0_IRQn);
5655
port_generic_handler(GPIOA, 0);
57-
test_tmp++;
5856
}
5957

6058
void PORT1_Handler(void)
6159
{
6260
port_generic_handler(GPIOB, 1);
63-
test_tmp++;
6461
}
6562

6663
void PORT2_Handler(void)
6764
{
6865
port_generic_handler(GPIOC, 2);
69-
test_tmp++;
7066
}
7167

7268
void PORT3_Handler(void)
7369
{
7470
port_generic_handler(GPIOD, 3);
75-
test_tmp++;
7671
}
7772

7873
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
119114
else
120115
obj->irq_n = PORT3_IRQn;
121116

122-
obj->event = EDGE_NONE;
123117
obj->pin = pin;
124118

125119
// Enable EXTI interrupt

targets/TARGET_WIZNET/TARGET_W7500x/pinmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void pin_mode(PinName pin, PinMode pupd)
117117
uint32_t port_num = WIZ_PORT(pin);
118118
uint32_t pin_num = WIZ_PIN_NUM(pin);
119119

120-
switch(port_num) {
120+
switch(port_num) {
121121
case PortA:
122122
if(pupd != 0)
123123
{

0 commit comments

Comments
 (0)