AS 7 import Arduino sketch Parser.Error

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Attempting to import a sketch is giving me "failed to import Arduino sketch parser.error"

The sketch is one that is working in Arduino IDE 1.8.5 and on an Uno R3...  anyone know if I am missing a place to see more information on the failure?  IE is there a log file or anything?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Post your Arduino sketch.

 

Then we can see where the AS7.0 is failing.

e.g. by importing for Uno,  Leonardo, ...

 

DAvid.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I found the culprit...  I had some function pointers that were making it unhappy:

void SS_PC1_LOW(){PORTC &= ~ (1<<PC1);}
void SS_PC1_HIGH(){PORTC |= (1<<PC1);}

void SS_PC2_LOW(){PORTC &= ~ (1<<PC2);}
void SS_PC2_HIGH(){PORTC |= (1<<PC2);}

void SS_PD4_LOW(){PORTD &= ~ (1<<PD4);}
void SS_PD4_HIGH(){PORTD |= (1<<PD4);}

void SS_PD5_LOW(){PORTD &= ~ (1<<PD5);}
void SS_PD5_HIGH(){PORTD |= (1<<PD5);}

void SS_PD6_LOW(){PORTD &= ~ (1<<PD6);}
void SS_PD6_HIGH(){PORTD |= (1<<PD6);}

void SS_PD7_LOW(){PORTD &= ~ (1<<PD7);}
void SS_PD7_HIGH(){PORTD |= (1<<PD7);}

void SS_PB0_LOW(){PORTB &= ~ (1<<PB0);}
void SS_PB0_HIGH(){PORTB |= (1<<PB0);}

const void (*SS_LOW_FUNC[])() = {SS_PC1_LOW,SS_PC2_LOW,SS_PD4_LOW,SS_PD5_LOW,SS_PD6_LOW,SS_PD7_LOW,SS_PB0_LOW};

const void (*SS_HIGH_FUNC[])() = {SS_PC1_HIGH,SS_PC2_HIGH,SS_PD4_HIGH,SS_PD5_HIGH,SS_PD6_HIGH,SS_PD7_HIGH,SS_PB0_HIGH};

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AS7.0 can't parse functions with pointer arguments.

 

However I would expect pointer arrays to get parsed ok.

function pointers as function arguments are optimistic.

 

I have never investigated.   But surely the Arduino IDE java parse and build tools are public domain.

So AS7.0 could simply steal them.

 

The real mystery is WHY?

The Arduino IDE works well.  It disables JTAG.   So you can't use hardware debugging without serious thought.

 

David.

Last Edited: Thu. Aug 1, 2019 - 07:13 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, David.  

No mystery...   The Teensy is just pitstop on the way to custom 32u4 based board.  I have half a project working in Arduino and half in AS7...  the half in AS7 is a custom LUFA based HID where the interface is legacy and dictated...  so either I can shoehorn the USB layer into the Teensyduino implementation and not have debug when moving to the primary hardware, rewrite the working sketch into AS7 from scratch, or import the working code.  

Rewriting is my first choice, but I borked the SPI layer somewhere, so importing and comparing the SPI implementations seemed simple enough.  I guess I could just clip out the bits I need rather than the full Arduino core...  And certainly I will have a debug header on my PCB eventually.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would use the Arduino USB code to implement the HID device.

Then you could develop and run it on the 2.00, 2.00++ or Teensy3.x boards.

 

There is probably an existing HID project that closely matches your needs.

 

I have a 3.2 but have never looked at the other Teensy boards.

How "similar" is the 2.00 to Leonardo/ProMicro ?

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

About to find out on the similarity, as I have a ProMicro inbound...  I do know that the pin assignment is not at all the same from the Leo to the Teensy...