Skip to content

"'reinterpret_cast' from integer to pointer" error during compiling #80

Description

@XDAChen

Hi,
I was getting this error message during compiling:

error: 'reinterpret_cast' from integer to pointer
53 | {&FTM0_SC, IRQ_FTM0, {{/25/NA, /44/22}, {/26/33, /45/23}, {/27/24, /46/ 9}, { NA, /49/10},
make[2]: *** [platform-teensy/CMakeFiles/vive-diy-position-sensor.dir/input_ftm.cpp.obj] Error 1

I then went to the code and changed from:

// FTM definitions: Ports, Interrupts and Input pins. constexpr static FTMDef timer_defs[] = { #if defined(__MK20DX128__) || defined(__MK20DX256__) // Teensy 3.0, 3.1, 3.2. Chip 64 LQFP pin numbers in comments. Teensy digital pins as numbers. {&FTM0_SC, IRQ_FTM0, {{/*25*/NA, /*44*/22}, {/*26*/33, /*45*/23}, {/*27*/24, /*46*/ 9}, { NA, /*49*/10},

to the following:

// FTM definitions: Ports, Interrupts and Input pins. static FTMDef timer_defs[] = { #if defined(__MK20DX128__) || defined(__MK20DX256__) // Teensy 3.0, 3.1, 3.2. Chip 64 LQFP pin numbers in comments. Teensy digital pins as numbers. {&FTM0_SC, IRQ_FTM0, {{/*25*/NA, /*44*/22}, {/*26*/33, /*45*/23}, {/*27*/24, /*46*/ 9}, { NA, /*49*/10},

After I deleted constexpr it did successfully compiled and I was able to upload the hex file to my teensy3.2 via Tycommander GUI.

The serial port currently outputs nothing, I am going to build the light sensor and set up vive lighthouse and see if I can get data.

I had checked online it seems that the later version of GCC gives this as an error rather than a warning. I am very rudimentary to cpp so I wonder if there is a better solution than a) changing the code like I did (not sure if it works) or b) installing an older version of GCC?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions