t
Fork of mbed-dev by
Diff: targets/hal/TARGET_Atmel/TARGET_SAM_CortexM0P/pinmap_function.c
- Revision:
- 64:41a834223ea3
- Parent:
- 18:da299f395b9e
diff -r 5964504d61de -r 41a834223ea3 targets/hal/TARGET_Atmel/TARGET_SAM_CortexM0P/pinmap_function.c --- a/targets/hal/TARGET_Atmel/TARGET_SAM_CortexM0P/pinmap_function.c Mon Feb 15 09:00:10 2016 +0000 +++ b/targets/hal/TARGET_Atmel/TARGET_SAM_CortexM0P/pinmap_function.c Mon Feb 15 10:00:10 2016 +0000 @@ -47,9 +47,9 @@ */ uint32_t pinmap_find_peripheral_from_pad(PinName pin, enum sercom_pad_selection pad_select) { - uint32_t pin_sercom = NC; + uint32_t pin_sercom =(uint32_t)NC; - if (pin == NC) return NC; + if (pin == NC) return (uint32_t)NC; if (pad_select == SERCOM_USE_EXTENDED_PAD) { pin_sercom = pinmap_find_peripheral(pin, PinMap_SERCOM_PADEx); @@ -99,7 +99,7 @@ { int i; uint32_t sercom_index[4]; - uint32_t pin_com = NC; + uint32_t pin_com = (uint32_t)NC; sercom_index[0] = pinmap_find_peripheral_from_pad(pin1, SERCOM_USE_DEFAULT_PAD); sercom_index[1] = pinmap_find_peripheral_from_pad(pin2, SERCOM_USE_DEFAULT_PAD); @@ -112,7 +112,7 @@ if (pin_com == (uint32_t)NC) { pin_com = sercom_index[i] & 0x0F; } else if (pin_com != (sercom_index[i] & 0x0F)) { - return NC; + return (uint32_t)NC; } } } @@ -128,12 +128,12 @@ */ uint32_t pinmap_function_sercom(PinName pin, uint32_t sercom_index) { - uint32_t func = NC; + uint32_t func = (uint32_t)NC; uint32_t index; sercom_index &= 0x0F; if ((pin == NC) || (sercom_index >= SERCOM_INST_NUM)) { - return NC; + return (uint32_t)NC; } index = pinmap_peripheral(pin, PinMap_SERCOM_PAD); if ((index & 0x0F) == sercom_index) { @@ -145,7 +145,7 @@ func = pinmap_function(pin, PinMap_SERCOM_PADEx); return func; } - return NC; + return (uint32_t)NC; } /** Find the MUX pad of input pin specific to given SERCOM index @@ -160,7 +160,7 @@ sercom_index &= 0x0F; if ((pin == NC) || (sercom_index >= SERCOM_INST_NUM)) { - return NC; + return (uint32_t)NC; } index = pinmap_peripheral(pin, PinMap_SERCOM_PAD); if ((index & 0x0F) == sercom_index) { @@ -170,7 +170,7 @@ if ((index & 0x0F) == sercom_index) { return ((index >> 4) & 0x0F); } - return NC; + return (uint32_t)NC; } /** Find the MUX function of input pin specific to given SERCOM index @@ -201,7 +201,7 @@ uint32_t index = sercom_index & 0x0F; if (index >= SERCOM_INST_NUM) { - return NC; + return (uint32_t)NC; } return sercom_address[(sercom_index&0x0F)]; } @@ -222,5 +222,5 @@ } pwm_ch++; } - return NC; + return (uint32_t)NC; }