Skip to content
This repository has been archived by the owner on Jun 5, 2019. It is now read-only.

Changed CPU_GPIO_DisablePin AltFunction parameter type to UINT32 #516

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ UINT32 CPU_GPIO_Attributes( GPIO_PIN Pin )
return GPIO_ATTRIBUTE_NONE;
}

void CPU_GPIO_DisablePin( GPIO_PIN Pin, GPIO_RESISTOR ResistorState, UINT32 Direction, GPIO_ALT_MODE AltFunction )
void CPU_GPIO_DisablePin( GPIO_PIN Pin, GPIO_RESISTOR ResistorState, UINT32 Direction, UINT32 AltFunction )
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ UINT32 CPU_GPIO_Attributes( GPIO_PIN pin )
}


void CPU_GPIO_DisablePin( GPIO_PIN pin, GPIO_RESISTOR resistor, UINT32 output, GPIO_ALT_MODE alternate )
void CPU_GPIO_DisablePin( GPIO_PIN pin, GPIO_RESISTOR resistor, UINT32 output, UINT32 alternate )
{
NATIVE_PROFILE_HAL_PROCESSOR_GPIO();
if (pin < STM32_Gpio_MaxPins) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ UINT32 CPU_GPIO_Attributes( GPIO_PIN pin )
* GPIO_ALT_MODE_3 | AF << 4 | speed << 8: Alternate Function with open drain
* speed: 0: 2MHZ, 1: 25MHz, 2: 50MHz, 3: 100MHz
*/
void CPU_GPIO_DisablePin( GPIO_PIN pin, GPIO_RESISTOR resistor, UINT32 output, GPIO_ALT_MODE alternate )
void CPU_GPIO_DisablePin( GPIO_PIN pin, GPIO_RESISTOR resistor, UINT32 output, UINT32 alternate )
{
NATIVE_PROFILE_HAL_PROCESSOR_GPIO( );
if( pin < STM32F4_Gpio_MaxPins )
Expand All @@ -355,7 +355,7 @@ void CPU_GPIO_DisablePin( GPIO_PIN pin, GPIO_RESISTOR resistor, UINT32 output, G
else if( altMode )
mode = 2; // alternate pin function

STM32F4_GPIO_Pin_Config( pin, mode, resistor, ( UINT32 )alternate );
STM32F4_GPIO_Pin_Config( pin, mode, resistor, alternate );
STM32F4_GPIO_Set_Interrupt( pin, NULL, 0, GPIO_INT_NONE, FALSE ); // disable interrupt
}
}
Expand Down
8 changes: 7 additions & 1 deletion DeviceCode/include/CPU_GPIO_decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ typedef void (*GPIO_INTERRUPT_SERVICE_ROUTINE)( GPIO_PIN Pin, BOOL PinState, voi
BOOL CPU_GPIO_Initialize ();
BOOL CPU_GPIO_Uninitialize ();
UINT32 CPU_GPIO_Attributes ( GPIO_PIN Pin );
void CPU_GPIO_DisablePin ( GPIO_PIN Pin, GPIO_RESISTOR ResistorState, UINT32 Direction, GPIO_ALT_MODE AltFunction );
void CPU_GPIO_DisablePin ( GPIO_PIN Pin, GPIO_RESISTOR ResistorState, UINT32 Direction, UINT32 AltFunction );
void CPU_GPIO_EnableOutputPin( GPIO_PIN Pin, BOOL InitialState );
BOOL CPU_GPIO_EnableInputPin ( GPIO_PIN Pin, BOOL GlitchFilterEnable, GPIO_INTERRUPT_SERVICE_ROUTINE PIN_ISR, GPIO_INT_EDGE IntEdge, GPIO_RESISTOR ResistorState );
BOOL CPU_GPIO_EnableInputPin2( GPIO_PIN Pin, BOOL GlitchFilterEnable, GPIO_INTERRUPT_SERVICE_ROUTINE PIN_ISR, void* ISR_Param, GPIO_INT_EDGE IntEdge, GPIO_RESISTOR ResistorState );
Expand All @@ -75,5 +75,11 @@ UINT8 CPU_GPIO_GetSupportedInterruptModes(GPIO_PIN pin );
UINT32 CPU_GPIO_GetPinDebounce( GPIO_PIN Pin );
BOOL CPU_GPIO_SetPinDebounce( GPIO_PIN Pin, INT64 debounceTimeMilliseconds );

// For backward compatibility
inline void CPU_GPIO_DisablePin(GPIO_PIN Pin, GPIO_RESISTOR ResistorState, UINT32 Direction, GPIO_ALT_MODE AltFunction)
{
return CPU_GPIO_DisablePin(Pin, ResistorState, Direction, (UINT32)AltFunction);
}

#endif // _DRIVERS_GPIO_DECL_H_

2 changes: 1 addition & 1 deletion Solutions/Windows2/TinyCLR/GPIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ UINT32 CPU_GPIO_Attributes( GPIO_PIN Pin )
return EmulatorNative::GetIGpioDriver()->Attributes( Pin );
}

void CPU_GPIO_DisablePin( GPIO_PIN Pin, GPIO_RESISTOR ResistorState, UINT32 Direction, GPIO_ALT_MODE AltFunction )
void CPU_GPIO_DisablePin( GPIO_PIN Pin, GPIO_RESISTOR ResistorState, UINT32 Direction, UINT32 AltFunction )
{
EmulatorNative::GetIGpioDriver()->DisablePin( Pin, ResistorState, Direction, AltFunction );
}
Expand Down