2022-07-15 02:00 PM
if (SW1Pressed_F && (!SW1ActionTaken_F))
{
DesiredSpeed = 10;
DesiredDirection = LEFT;
}
if (SW1Pressed_F && (!SW1ActionTaken_F))
{
DesiredSpeed = 10;
DesiredDirection = LEFT;
}
Solved! Go to Solution.
2022-07-19 04:13 AM
Formatting the source code can either be done by the editor, or many GUIs already contain it. The STM32CubeIDE, for example, is able to apply such formatting as an Eclipse variant with so-called profiles. Some profiles are already predefined, but you can also modify them and save or export them under your preferred name.
By the way, exporting a profile is very useful because you can import the exported profile into new installations with just a few clicks.
How to reach the Formatter:
or a little shorter:
Modify an existing profile:
Export:
Perhaps my Kernighan&Richie-derived Quick'n'Dirty profile (attached) will be of interest to you and could serve as a template.
Regards
/Peter
2022-07-15 02:02 PM
Note that the forum messed up my columns in the example, but my statement is correct.
2022-07-15 02:04 PM
Trying again...
if (SW1Pressed_F && (!SW1ActionTaken_F))
{
DesiredSpeed = 10;
DesiredDirection = LEFT;
}
if (SW1Pressed_F && (!SW1ActionTaken_F))
{
DesiredSpeed = 10;
DesiredDirection = LEFT;
}
2022-07-15 02:05 PM
Nope, screwed it up again
2022-07-15 02:11 PM
You can a) Edit your posts see V icon in upper right corner of posting, b) use the code posting tool </> icon, or c) post a picture or bitmap mountain/sub icon
2022-07-18 12:52 AM
Hello,
Something like this?
if (SW1Pressed_F && (!SW1ActionTaken_F))
{
DesiredSpeed = 10;
DesiredDirection = LEFT;
}
2022-07-18 09:31 AM
2022-07-19 03:35 AM
Aren't there tools like Uncrustify that can apply any kind of formatting template you want?
2022-07-19 04:13 AM
Formatting the source code can either be done by the editor, or many GUIs already contain it. The STM32CubeIDE, for example, is able to apply such formatting as an Eclipse variant with so-called profiles. Some profiles are already predefined, but you can also modify them and save or export them under your preferred name.
By the way, exporting a profile is very useful because you can import the exported profile into new installations with just a few clicks.
How to reach the Formatter:
or a little shorter:
Modify an existing profile:
Export:
Perhaps my Kernighan&Richie-derived Quick'n'Dirty profile (attached) will be of interest to you and could serve as a template.
Regards
/Peter
2022-07-20 09:42 AM