SpenceKonde / megaTinyCore

Arduino core for the tinyAVR 0/1/2-series - Ones's digit 2,4,5,7 (pincount, 8,14,20,24), tens digit 0, 1, or 2 (featureset), preceded by flash in kb. Library maintainers: porting help available!
Other
544 stars 141 forks source link

Compiling for attiny1616 using default settings fails #955

Closed Bdenouden closed 1 year ago

Bdenouden commented 1 year ago

When compiling an empty sketch for the attiny1616 using the default settings in Arduino IDE 1.8.13 the error below appears. This error appears for the same sketch and settings in all the attinyXX16 boards

Sketch:

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

Settings: image

Result:

Arduino: 1.8.13 (Windows 10), Board: "ATtiny3226/3216/1626/1616/1606/826/816/806/426/416/406, ATtiny1616, 20 MHz internal, 1.8V (5 MHz or less), Disabled/Disabled, EEPROM retained, Enabled (default timer), UPDI (no reset pin), 8ms, Master or Slave (saves flash and RAM), Default (doesn't print floats, 1.4k flash use), PB0-2, PA3-5, 1-series: PC0/1 (default), Disabled (recommended), No delay before window "opens""

C:\Users\bramd\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.7\cores\megatinycore\wiring_analog.c: In function 'analogWrite':

C:\Users\bramd\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.7\cores\megatinycore\wiring_analog.c:1205:13: error: 'set_inven' undeclared (first use in this function); did you mean 'strnlen'?

             set_inven = 1;

             ^~~~~~~~~

             strnlen

C:\Users\bramd\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.7\cores\megatinycore\wiring_analog.c:1205:13: note: each undeclared identifier is reported only once for each function it appears in

C:\Users\bramd\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.7\cores\megatinycore\wiring_analog.c:1307:5: error: break statement not within loop or switch

     break;

     ^~~~~

C:\Users\bramd\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.7\cores\megatinycore\wiring_analog.c:1317:5: error: case label not within a switch statement

     case NOT_ON_TIMER: /*falls through*/

     ^~~~

C:\Users\bramd\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.7\cores\megatinycore\wiring_analog.c:1318:5: error: 'default' label not within a switch statement

     default:

     ^~~~~~~

C:\Users\bramd\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.7\cores\megatinycore\wiring_analog.c:1325:7: error: break statement not within loop or switch

       break;

       ^~~~~

In file included from C:\Users\bramd\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.7\cores\megatinycore\api/ArduinoAPI.h:52:0,

                 from C:\Users\bramd\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.7\cores\megatinycore\Arduino.h:26,

                 from C:\Users\bramd\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.7\cores\megatinycore\wiring_private.h:32,

                 from C:\Users\bramd\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.7\cores\megatinycore\wiring_analog.c:25:

C:\Users\bramd\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.7\cores\megatinycore\wiring_analog.c: At top level:

C:\Users\bramd\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.7\cores\megatinycore\api/Common.h:16:26: error: expected ')' before numeric constant

 #define OUTPUT           1    /* used for pinMode() */

                          ^

C:\Users\bramd\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.7\cores\megatinycore\wiring_analog.c:1330:16: note: in expansion of macro 'OUTPUT'

   pinMode(pin, OUTPUT);

                ^~~~~~

C:\Users\bramd\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.7\cores\megatinycore\wiring_analog.c:1331:1: error: expected identifier or '(' before '}' token

 } // end of analogWrite

 ^

exit status 1

Error compiling for board ATtiny3226/3216/1626/1616/1606/826/816/806/426/416/406.
SpenceKonde commented 1 year ago

Already reported like five times, I botched the implementation of the PWM mapping menu for 1-series parts.

It is corrected in github version and a release will be done once several other issues are solved