Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino Compiling error #1

Open
einencool opened this issue Aug 18, 2022 · 3 comments
Open

Arduino Compiling error #1

einencool opened this issue Aug 18, 2022 · 3 comments

Comments

@einencool
Copy link

Hello,

I wanted to update my machine from a version from 2021, but when I try to compile the code with Arduino IDE 1.8.13 I get the following Error. I can't flash my Teensy 4.1 Board.
When I disable the Plugin in the file "mymachine.h", it works without a problem.
#define QEI_ENABLE 1 // Enable quadrature encoder interfaces. Max value is 1. Requires encoder plugin.

Arduino: 1.8.13 (Windows 10), TD: 1.57, Board: "Teensy 4.1, Serial, 600 MHz, Faster, German" C:\Users\xxx\OneDrive\Dokumente\Arduino\libraries\grblHAL_Teensy4\src\encoder\encoder.c: In function 'encoder_init': C:\Users\xxx\OneDrive\Dokumente\Arduino\libraries\grblHAL_Teensy4\src\encoder\encoder.c:790:16: error: 'setting_details_t {aka struct setting_details}' has no member named 'on_get_settings' details.on_get_settings = grbl.on_get_settings; C:\Users\xxx\OneDrive\Dokumente\Arduino\libraries\grblHAL_Teensy4\src\encoder\encoder.c: At top level: C:\Users\xxx\OneDrive\Dokumente\Arduino\libraries\grblHAL_Teensy4\src\encoder\encoder.c:113:13: warning: 'mpg_move_absolute' defined but not used [-Wunused-function] static bool mpg_move_absolute (sys_state_t state, axes_signals_t axes) Fehler beim Kompilieren für das Board Teensy 4.1.

Does anyone have the same issue? Or is there something I'm missing :-)

@terjeio
Copy link
Contributor

terjeio commented Aug 21, 2022

Replace the init function with this code:

bool encoder_init (uint_fast8_t n_encoders)
{
    if((nvs_address = nvs_alloc(sizeof(encoder_settings_t) * n_encoders))) {
        n_encoder = n_encoders;

        settings_register(&details);

        hal.encoder.get_n_encoders = get_n_encoders;
        hal.encoder.on_event = encoder_event;

        on_report_options = grbl.on_report_options;
        grbl.on_report_options = onReportOptions;
    }

    return nvs_address != 0;
}

FYI I have not tested the fix yet - will do so later.

@einencool
Copy link
Author

Hi Terje,
It seems, that there is a problem with the Encoder.
When I activate it, it compiles with these messages, but I can't connect to the board.
When I deactivate the option, it seems to work, but the encoder don't work

C:\Users\xxx\OneDrive\Dokumente\Arduino\libraries\grblHAL_Teensy4\src\encoder\encoder.c:113:13: warning: 'mpg_move_absolute' defined but not used [-Wunused-function] static bool mpg_move_absolute (sys_state_t state, axes_signals_t axes) C:\Users\xxx\OneDrive\Dokumente\Arduino\libraries\grblHAL_Teensy4\src\encoder\encoder.c:555:27: warning: 'on_get_settings' defined but not used [-Wunused-function] static setting_details_t *on_get_settings (void) Opening Teensy Loader...

@terjeio
Copy link
Contributor

terjeio commented Aug 28, 2022

Oops, another regression...

Move these lines to line 2295 (just before the #ifUSB_SERIAL_CDC line).

I will update when I have finished some other changes that are pending (related to networking).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants