Just an update about the WeAct board and negated pins - looks like stm32 port does not have support for negated pins. At least not in same way as nrf5x port.
For nrf5x there is runtime check for pinInfo[pin].port & JSH_PIN_NEGATED and value and possible pull ups/downs are negated. I am not sure if this is actually good solution in NRF code but anyway there is nothing like that in stm32 code.
So I have extended the patch http://microcosm.app/out/78xji to handle negated pins in get/set value but in NRF code there is more (pull ups, downs in get/set pin state)
also visible on board file changes https://gist.github.com/fanoush/7553104fa7c8c596fe91f276d3f297fd/revisions is that there was other inverted flag used for pin configuration (got it from other stm32 board files) but it did not work as expected (or at all) so I removed it and added the nrf5x style NEGATED flag instead
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Just an update about the WeAct board and negated pins - looks like stm32 port does not have support for negated pins. At least not in same way as nrf5x port.
For nrf5x there is runtime check for
pinInfo[pin].port & JSH_PIN_NEGATED
and value and possible pull ups/downs are negated. I am not sure if this is actually good solution in NRF code but anyway there is nothing like that in stm32 code.So I have extended the patch http://microcosm.app/out/78xji to handle negated pins in get/set value but in NRF code there is more (pull ups, downs in get/set pin state)
Anyway here is updated binary https://filebin.ca/5hFTUCKr4JA5/espruino_2v08.5_weactf411.bin where button and led works as expected - button skips startup code if held, LED is off at startup.
The question about how to handle negated pins remains, should the (extra) nrf5x code be copied to stm32 port? To see more start here https://github.com/espruino/Espruino/blob/master/targets/nrf5x/jshardware.c#L966 and search for JSH_PIN_NEGATED. Similar stm32 code is here https://github.com/espruino/Espruino/blob/master/targets/stm32/jshardware.c#L1036 - check methods
jshPinSetValue
,jshPinGetValue
also visible on board file changes https://gist.github.com/fanoush/7553104fa7c8c596fe91f276d3f297fd/revisions is that there was other
inverted
flag used for pin configuration (got it from other stm32 board files) but it did not work as expected (or at all) so I removed it and added the nrf5x style NEGATED flag insteadEDIT: fixed few more bugs and updated to latest
https://filebin.ca/5hG1r5OvrY9N/espruino_2v08.82_weactf411.bin