Skip to content

Multiple definition of delay #7

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

Closed
simon88 opened this issue Jul 12, 2022 · 2 comments
Closed

Multiple definition of delay #7

simon88 opened this issue Jul 12, 2022 · 2 comments
Assignees
Labels
Seeed_Arduino_FreeRTOS Label for Seeed_Arduino_FreeRTOS UAY Unassigned yet

Comments

@simon88
Copy link

simon88 commented Jul 12, 2022

Hi,
I got an error when I try to compiled for an SAMD21E17A multiple definition of delay conflit with delay.c in samd core and delay in FreeRTOSVariant.c

/*
 * override Arduino delay()
 */
extern void _real_delay(unsigned long ms);
void delay(unsigned long ms)
{
  if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)
  {
    vTaskDelay(ms / portTICK_PERIOD_MS);
  }
  else
  {
    _real_delay(ms);
  }
}

If I renamed this function by delay2 for examle it's works but it's doesn't compile beceause delay2 was not declared in this scope...

@MatthewJeffson MatthewJeffson added UAY Unassigned yet Seeed_Arduino_FreeRTOS Label for Seeed_Arduino_FreeRTOS labels Oct 9, 2024
@Lesords Lesords self-assigned this Oct 14, 2024
@Lesords Lesords assigned LynnL4 and unassigned Lesords Oct 16, 2024
@LynnL4
Copy link
Member

LynnL4 commented Oct 18, 2024

hi,delay is weak by default and should be able to be overloaded normally.
https://github.com/Seeed-Studio/ArduinoCore-samd/blob/d7c6a8f4b9661a3e28a25e11afca2c2c35f519f4/cores/arduino/delay.c#L138

@Lesords
Copy link
Contributor

Lesords commented Nov 4, 2024

Hello,

I'm going to close this issue, feel free to re-open it if you have any other questions.

[Autocommentary]

@Lesords Lesords closed this as completed Nov 4, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues and PR Assemble Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Seeed_Arduino_FreeRTOS Label for Seeed_Arduino_FreeRTOS UAY Unassigned yet
Projects
Status: Done
Development

No branches or pull requests

4 participants