I have changed the "How to Implement STM32" document.
Available from top post.
Note:
Improved B4R integration using the existing STM32 library define
_VARIANT_ARDUINO_STM32_
instead of my own define
USING_STM32
No need to add or remove a define from the B4R defines template when changing board types.
Wish:
It would now be possible to include the altered "Pin::setMode" code into B4R distribution so no additional patch would be required.
//*******************************************
void Pin::setMode(Byte arduino_Mode) {
#ifdef _VARIANT_ARDUINO_STM32_
WiringPinMode stm32_Mode;
switch (arduino_Mode) {
case INPUT:
stm32_Mode = INPUT;
break;
case OUTPUT:
stm32_Mode = OUTPUT;
break;
case INPUT_PULLUP:
stm32_Mode = INPUT_PULLUP;
break;
}
pinMode(PinNumber, stm32_Mode);
#else
pinMode(PinNumber, arduino_Mode);
#endif
if (arduino_Mode == INPUT_PULLUP)
CurrentValue = true;
}
//******************************************