Editing the files manually with the contents of that PR manually in PlatformIO fixes the issue too, so it seems like the latest version of sduino with that fix is not being pulled in or something? I'd submit a PR to fix it, but I can't find where the code for framework-arduinoststm8 lives...
This is the same problem as described in this issue: https://github.com/tenbaht/sduino/issues/72, which this pull request fixes: https://github.com/tenbaht/sduino/pull/73
Editing the files manually with the contents of that PR manually in PlatformIO fixes the issue too, so it seems like the latest version of sduino with that fix is not being pulled in or something? I'd submit a PR to fix it, but I can't find where the code for framework-arduinoststm8 lives...