You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
" // put your main code here, to run repeatedly:",
"}",
"",
]
)
elifframework=="mbed":
main_content="\n".join(
[
"#include <mbed.h>",
"",
"int main() {",
"",
" // put your setup code here, to run once:",
"",
" while(1) {",
" // put your main code here, to run repeatedly:",
" }",
"}",
"",
]
)
ifnotmain_content:
returnproject_dir
withfs.cd(project_dir):
config=ProjectConfig()
src_dir=config.get_optional_dir("src")
main_path=os.path.join(src_dir, "main.cpp")
will always create a src/main.cpp file. This however is wrong since for the STM8, the implementation is written in C and users must also use C files (The SDCC compiler does not support C++). All the examples use .c files.
Maybe this change is also needed in other platforms. Besides STM8 I can't think of other C-only Arduino core implementations (Intel 8080 doesn't have a core)
Steps to Reproduce
Open PlatformIO Home
Create new project
Select e.g. "sduino UNO" as board and "Arduino" as framework
Create project
Actual Results
A src/main.cpp file with template code is generated and compilation fails because the it attempts to use the system's CXX / C++ compiler.
Expected Results
A src/main.c file is generated.
Due to a quirk in the SDCC compiler however, a semantically empty sketch fails to link, so a linking error after that is expected.. maybe a different template can be used there.
If problems with PlatformIO Build System:
-/-
Additional info
-/-
The text was updated successfully, but these errors were encountered:
What kind of issue is this?
If you’ve found a bug, please provide an information below.
You can erase any parts of this template not applicable to your Issue.
Configuration
Operating system: Win10 x64
PlatformIO Version (
platformio --version
): version 5.1.1a3Description of problem
When a new project for any STM8 board with the Arduino framework is created, the PlatformIO core logic at
platformio-core/platformio/commands/home/rpc/handlers/project.py
Lines 206 to 244 in 81c7e23
will always create a
src/main.cpp
file. This however is wrong since for the STM8, the implementation is written in C and users must also use C files (The SDCC compiler does not support C++). All the examples use.c
files.Refer to topic https://community.platformio.org/t/unable-to-compile-new-created-project-for-stm8s-board/19766 and platformio/platform-ststm8#21 (comment)
Maybe this change is also needed in other platforms. Besides STM8 I can't think of other C-only Arduino core implementations (Intel 8080 doesn't have a core)
Steps to Reproduce
Actual Results
A
src/main.cpp
file with template code is generated and compilation fails because the it attempts to use the system's CXX / C++ compiler.Expected Results
A
src/main.c
file is generated.Due to a quirk in the SDCC compiler however, a semantically empty sketch fails to link, so a linking error after that is expected.. maybe a different template can be used there.
If problems with PlatformIO Build System:
-/-
Additional info
-/-
The text was updated successfully, but these errors were encountered: