LPC2368 [GCC_ARM]: Silence some warnings.

pull/66/head
dinau 2013-09-13 21:59:20 +09:00
parent 43acaa4166
commit efbc52465d
5 changed files with 8 additions and 8 deletions

View File

@ -42,7 +42,7 @@ static const PinMap PinMap_ADC[] = {
void analogin_init(analogin_t *obj, PinName pin) { void analogin_init(analogin_t *obj, PinName pin) {
obj->adc = (ADCName)pinmap_peripheral(pin, PinMap_ADC); obj->adc = (ADCName)pinmap_peripheral(pin, PinMap_ADC);
if (obj->adc == (uint32_t)NC) { if (obj->adc == (ADCName)NC) {
error("ADC pin mapping failed"); error("ADC pin mapping failed");
} }

View File

@ -25,7 +25,7 @@ static const PinMap PinMap_DAC[] = {
void analogout_init(dac_t *obj, PinName pin) { void analogout_init(dac_t *obj, PinName pin) {
obj->dac = (DACName)pinmap_peripheral(pin, PinMap_DAC); obj->dac = (DACName)pinmap_peripheral(pin, PinMap_DAC);
if (obj->dac == (uint32_t)NC) { if (obj->dac == (DACName)NC) {
error("DAC pin mapping failed"); error("DAC pin mapping failed");
} }

View File

@ -697,7 +697,7 @@ int ethernet_receive() {
if(receive_idx == -1) { if(receive_idx == -1) {
receive_idx = LPC_EMAC->RxConsumeIndex; receive_idx = LPC_EMAC->RxConsumeIndex;
} else { } else {
while(!(rxstat[receive_idx].Info & RINFO_LAST_FLAG) && (receive_idx != LPC_EMAC->RxProduceIndex)) { while(!(rxstat[receive_idx].Info & RINFO_LAST_FLAG) && ((uint32_t)receive_idx != LPC_EMAC->RxProduceIndex)) {
receive_idx = rinc(receive_idx, NUM_RX_FRAG); receive_idx = rinc(receive_idx, NUM_RX_FRAG);
} }
unsigned int info = rxstat[receive_idx].Info; unsigned int info = rxstat[receive_idx].Info;
@ -713,7 +713,7 @@ int ethernet_receive() {
LPC_EMAC->RxConsumeIndex = receive_idx; LPC_EMAC->RxConsumeIndex = receive_idx;
} }
if(receive_idx == LPC_EMAC->RxProduceIndex) { if((uint32_t)receive_idx == LPC_EMAC->RxProduceIndex) {
receive_idx = -1; receive_idx = -1;
return 0; return 0;
} }
@ -762,7 +762,7 @@ int ethernet_read(char *data, int dlen) {
void *pdst, *psrc; void *pdst, *psrc;
int doff = 0; int doff = 0;
if(receive_idx == LPC_EMAC->RxProduceIndex || receive_idx == -1) { if((uint32_t)receive_idx == LPC_EMAC->RxProduceIndex || receive_idx == -1) {
return 0; return 0;
} }

View File

@ -17,7 +17,7 @@
#include "error.h" #include "error.h"
void pin_function(PinName pin, int function) { void pin_function(PinName pin, int function) {
if (pin == (uint32_t)NC) return; if (pin == (PinName)NC) return;
uint32_t pin_number = (uint32_t)pin - (uint32_t)P0_0; uint32_t pin_number = (uint32_t)pin - (uint32_t)P0_0;
int index = pin_number >> 4; int index = pin_number >> 4;
@ -28,7 +28,7 @@ void pin_function(PinName pin, int function) {
} }
void pin_mode(PinName pin, PinMode mode) { void pin_mode(PinName pin, PinMode mode) {
if (pin == (uint32_t)NC) { return; } if (pin == (PinName)NC) { return; }
uint32_t pin_number = (uint32_t)pin - (uint32_t)P0_0; uint32_t pin_number = (uint32_t)pin - (uint32_t)P0_0;
int index = pin_number >> 5; int index = pin_number >> 5;

View File

@ -57,7 +57,7 @@ static unsigned int pwm_clock_mhz;
void pwmout_init(pwmout_t* obj, PinName pin) { void pwmout_init(pwmout_t* obj, PinName pin) {
// determine the channel // determine the channel
PWMName pwm = (PWMName)pinmap_peripheral(pin, PinMap_PWM); PWMName pwm = (PWMName)pinmap_peripheral(pin, PinMap_PWM);
if (pwm == (uint32_t)NC) if (pwm == (PWMName)NC)
error("PwmOut pin mapping failed"); error("PwmOut pin mapping failed");
obj->pwm = pwm; obj->pwm = pwm;