Skip to content

Fixed GCC Compiler warnings #1543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed style and build issue
  • Loading branch information
Parthasarathy.S committed Feb 14, 2016
commit a8e52a9fc0d32bfb10cd27ba38a43451f00c46dd
Original file line number Diff line number Diff line change
Expand Up @@ -205,18 +205,18 @@ const struct pwm_pin_channel pwn_pins[] = {
{PA17, PWM_2, 1},
{PA18, PWM_0, 2},
{PA19, PWM_0, 3},
{PA20, PWM_0, 6},
{PA22, PWM_0, 4},
{PA23, PWM_0, 5},
{PA24, PWM_1, 2},
{PA25, PWM_1, 3},
{PA30, PWM_1, 0},
{PA31, PWM_1, 1},
{PB16, PWM_0, 4},
{PB17, PWM_0, 5},
{PB30, PWM_0, 0},
{PB31, PWM_0, 1},
{PA20, PWM_0, 6},
{PA22, PWM_0, 4},
{PA23, PWM_0, 5},
{PA24, PWM_1, 2},
{PA25, PWM_1, 3},
{PA30, PWM_1, 0},
{PA31, PWM_1, 1},
{PB16, PWM_0, 4},
{PB17, PWM_0, 5},
{PB30, PWM_0, 0},
{PB31, PWM_0, 1},

/* Not connected */
{(PinName) NC ,(PWMName) NC ,(uint8_t) NC}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ bool dma_is_transfer_complete(int channelid)

if (channel_index >= CONF_MAX_USED_CHANNEL_NUM) {
/* This channel is not active! return zero for now */
// res = 0;
return 0;
// res = 0;
return 0;
}

return (STATUS_OK == dma_get_job_status(&dma_channels[channel_index].resource));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,9 @@ enum status_code system_clock_source_write_calibration(
{
switch (clock_source) {
case SYSTEM_CLOCK_SOURCE_OSC8M:
if (calibration_value > 0xfff || freq_range > 4)
{
return STATUS_ERR_INVALID_ARG;
}
if (calibration_value > 0xfff || freq_range > 4) {
return STATUS_ERR_INVALID_ARG;
}
SYSCTRL->OSC8M.bit.CALIB = calibration_value;
SYSCTRL->OSC8M.bit.FRANGE = freq_range;
break;
Expand All @@ -510,7 +509,7 @@ enum status_code system_clock_source_write_calibration(
default:
Assert(false);
return STATUS_ERR_INVALID_ARG;
}
}
return STATUS_OK;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ enum status_code system_clock_source_write_calibration(
default:
Assert(false);
return STATUS_ERR_INVALID_ARG;

}

return STATUS_OK;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void gpio_dir(gpio_t *obj, PinDirection direction)
{
MBED_ASSERT(obj->pin != (PinName)NC);
struct port_config pin_conf;
obj->direction = direction;
obj->direction = direction;
pin_conf.input_pull = (enum port_pin_pull)obj->mode;
pin_conf.powersave = obj->powersave;
switch (direction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -924,20 +924,20 @@ uint32_t i2c_irq_handler_asynch(i2c_t *obj)
uint32_t event_mask = pI2C_S(obj)->events;

/* TODO: Current implementation is interrupt based only */

switch (pI2C_S(obj)->master.status) {
case STATUS_OK:
/* Transfer is complete */
return (I2C_EVENT_TRANSFER_COMPLETE & event_mask);

case STATUS_ERR_BAD_ADDRESS:
/* Received a NACK */
return (I2C_EVENT_ERROR_NO_SLAVE & event_mask);

case STATUS_ERR_PACKET_COLLISION:
/* An error occurred in between transfer */
return (I2C_EVENT_ERROR & event_mask);

default:
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static inline void reset_usart(serial_t *obj)

/* Reset module */
_USART(obj).CTRLA.reg = SERCOM_USART_CTRLA_SWRST;
SUPPRESS_WARNING(reset_usart);
SUPPRESS_WARNING(reset_usart);
}

uint32_t serial_find_mux_settings (serial_t *obj)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ static enum status_code _spi_transceive_buffer(spi_t *obj)
void spi_master_transfer(spi_t *obj, const void *tx, size_t tx_length, void *rx, size_t rx_length, uint8_t bit_width, uint32_t handler, uint32_t event, DMAUsage hint)
{
uint16_t dummy_read;
(void) dummy_read;
(void) dummy_read;
/* Sanity check arguments */
MBED_ASSERT(obj);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ void us_ticker_init(void)

/* Initialize the timer */
tc_init(&us_ticker_module, TICKER_COUNTER_uS, &config_tc);
MBED_ASSERT(ret_status == STATUS_OK);

/* Register callback function */
tc_register_callback(&us_ticker_module, (tc_callback_t)us_ticker_irq_handler_internal, TC_CALLBACK_CC_CHANNEL0);
Expand Down