Unterminated #ifdef

I’m working on a new config for a new saber. I started by copying and pasting a config that works from my last saber. I did change the fonts using Fett263 OS6 style library and take out #define ORIENTATION ORIENTATION_USB_TOWARDS_BLADE
#endif because the board faces the other way. Here is the error code and Pastebin to full config.

Arduino: 1.8.19 (Mac OS X), TD: 1.57, Board: “Proffieboard V2, Serial + WebUSB, SDCARD (SPI), 80 MHz, Smallest Code”

In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:55:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:2: error: unterminated #ifdef
2 | #ifdef CONFIG_TOP
|
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:2: error: unterminated #ifdef
2 | #ifdef CONFIG_TOP
|
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:567:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:2: error: unterminated #ifdef
2 | #ifdef CONFIG_TOP
|
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:629:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:2: error: unterminated #ifdef
2 | #ifdef CONFIG_TOP
|
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:1528:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:2: error: unterminated #ifdef
2 | #ifdef CONFIG_TOP
|
exit status 1
Error compiling for board Proffieboard V2.

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

It looks like I needed another #endif on line 38. When I put that in and saved and verified in Arduino, things got even worse. Again, these came from the Fett263 OS 6 style library with no alternations so it shouldn’t be giving me error messages…

Arduino: 1.8.19 (Mac OS X), TD: 1.57, Board: “Proffieboard V2, Serial + WebUSB, SDCARD (SPI), 80 MHz, Smallest Code”

In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:177:2: error: expected ‘}’ before ‘;’ token
177 | };
| ^
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:127:4: note: to match this ‘{’
127 | { “Blindcowboy;common”, “tracks/track.wav”,
| ^
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:177:2: error: expected ‘}’ before ‘;’ token
177 | };
| ^
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:102:4: note: to match this ‘{’
102 | { “Obi3;common”, “tracks/track.wav”,
| ^
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:177:2: error: expected ‘}’ before ‘;’ token
177 | };
| ^
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:76:4: note: to match this ‘{’
76 | { “Obi2;common”, “tracks/track.wav”,
| ^
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:177:2: error: expected ‘}’ before ‘;’ token
177 | };
| ^
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:51:4: note: to match this ‘{’
51 | { “Obi1;common”, “tracks/track.wav”,
| ^
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:177:2: error: expected ‘}’ before ‘;’ token
177 | };
| ^
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:47:20: note: to match this ‘{’
47 | Preset presets[] = {
| ^
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:177:2: error: cannot convert ‘’ to ‘const char*’ in initialization
177 | };
| ^
exit status 1
Error compiling for board Proffieboard V2.

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

Looks like your presets are missing the ending }, part.

I’ll try adding it but why would that be? They were pasted directly from the blade library.

The style library only generates style code, the brackets are part of the preset in your config:

{ "font:common", "font/tracks/track.wav",
StylePtr<...>(),
"name"
},

If you need help with syntax try the config helper tool.

The config helper is what generated the rest of the config.

You used the tool to generate the entire config and that’s what it output?
Did you actually build the presets in the tool or paste them in separately?
Something seems off, the config tool automatically appends the “name” field and close of each preset but your config is missing both in each preset. I recreated your exact config using the tool and it produced the correct syntax so if you generated the full config in the tool I need a little more information on the steps you took because I don’t see how it would have missed the preset syntax.

I did the fonts individually using the blade library. It’s fine. I see how to use it now. Thanks.

OK, yeah the tool will handle the preset syntax for you, when you pasted you forgot the closing of each preset.

I didn’t forget. I didn’t know. Still learning haha. But I’m getting there.

New issue. Even if I activate gesture sleep (hold power and twist) I can still twist saber off. The other motions turn off correctly though. I’m sure there’s an error in my config (probably at the top of my config). It’s above. Can you take a quick peek?

Gesture Sleep only applies to Ignition. It is to allow you to carry or wear your saber without worrying about it accidentally igniting.

Is there a way to easily turn gesture on and off from the saber?

Enable Edit Mode or Edit Settings > under Edit Controls :wink:

I enabled edit mode but haven’t messed with it yet. Thanks