Strange Errors when checking Krosgaard Code

I need a little help :frowning: I just got a Sabertrio Krosgaard, and I’m trying to install some custom fonts, but I can’t get the code to check out in Arduino. I’ve had a Krosgaard in the past, but I don’t remember getting these error messages. It seems to have something to do with blade settings, but I’m not sure. These are the errors I’m getting:

In file included from C:\Users\ajbur\Desktop\LIGHTSABER FILES\My Sabertrio Krosgaard\extra\ProffieOS\ProffieOS.ino:627:
C:\Users\ajbur\Desktop\LIGHTSABER FILES\My Sabertrio Krosgaard\extra\ProffieOS\config\s3config_v3_Legacy_Kros.h:1228:13: error: expected primary-expression before 'blades'
 1228 | BladeConfig blades[] = {
      |             ^~~~~~
C:\Users\ajbur\Desktop\LIGHTSABER FILES\My Sabertrio Krosgaard\extra\ProffieOS\config\s3config_v3_Legacy_Kros.h:1228:13: error: expected '}' before 'blades'
In file included from C:\Users\ajbur\Desktop\LIGHTSABER FILES\My Sabertrio Krosgaard\extra\ProffieOS\ProffieOS.ino:627:
C:\Users\ajbur\Desktop\LIGHTSABER FILES\My Sabertrio Krosgaard\extra\ProffieOS\config\s3config_v3_Legacy_Kros.h:50:18: note: to match this '{'
   50 | Preset blade[] = {
      |                  ^
In file included from C:\Users\ajbur\Desktop\LIGHTSABER FILES\My Sabertrio Krosgaard\extra\ProffieOS\ProffieOS.ino:627:
C:\Users\ajbur\Desktop\LIGHTSABER FILES\My Sabertrio Krosgaard\extra\ProffieOS\config\s3config_v3_Legacy_Kros.h:1228:13: error: too many initializers for 'Preset'
 1228 | BladeConfig blades[] = {
      |             ^~~~~~
In file included from C:\Users\ajbur\Desktop\LIGHTSABER FILES\My Sabertrio Krosgaard\extra\ProffieOS\ProffieOS.ino:246:
C:\Users\ajbur\Desktop\LIGHTSABER FILES\My Sabertrio Krosgaard\extra\ProffieOS\props\prop_base.h: In member function 'size_t PropBase::FindBestConfig()':
C:\Users\ajbur\Desktop\LIGHTSABER FILES\My Sabertrio Krosgaard\extra\ProffieOS\props\prop_base.h:567:25: error: 'blades' was not declared in this scope; did you mean 'blade'?
  567 |     static_assert(NELEM(blades) > 0, "blades array cannot be empty");
      |                         ^~~~~~
C:\Users\ajbur\Desktop\LIGHTSABER FILES\My Sabertrio Krosgaard\extra\ProffieOS\common\common.h:18:26: note: in definition of macro 'NELEM'
   18 | #define NELEM(X) (sizeof(X)/sizeof((X)[0]))
      |                          ^
In file included from C:\Users\ajbur\Desktop\LIGHTSABER FILES\My Sabertrio Krosgaard\extra\ProffieOS\props\saber_sabertrio_buttons.h:223,
                 from C:\Users\ajbur\Desktop\LIGHTSABER FILES\My Sabertrio Krosgaard\extra\ProffieOS\config\s3config_v3_Legacy_Kros.h:44,
                 from C:\Users\ajbur\Desktop\LIGHTSABER FILES\My Sabertrio Krosgaard\extra\ProffieOS\ProffieOS.ino:631:
C:\Users\ajbur\Desktop\LIGHTSABER FILES\My Sabertrio Krosgaard\extra\ProffieOS\props\prop_base.h: In member function 'void PropBase::FindBlade()':
C:\Users\ajbur\Desktop\LIGHTSABER FILES\My Sabertrio Krosgaard\extra\ProffieOS\props\prop_base.h:622:22: error: 'blades' was not declared in this scope; did you mean 'blade'?
  622 |     current_config = blades + best_config;
      |                      ^~~~~~
      |                      blade

exit status 1

Compilation error: expected primary-expression before 'blades'

Here is my config file

I would really appreciate any help you can offer :slight_smile:

It looks like you may have and extra style in some of the later presets. You need three and I think there’s 4.

You’re not terminating your presets[].

tl;dr; you’re missing ‘};’ before the blades[] array.

You can read more about it here:

Wow, that was simple, LOL. Thanks guys, I appreciate it.

I added the ‘};’, and then Arduino didn’t seem to like the StylePtr<WHITE>(),in 6 of the presets.

It’s all good now. :smiley:

1 Like