Skip to content

Fix micros() for nano without breaking giga #62

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

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

KurtE
Copy link

@KurtE KurtE commented Jan 30, 2025

Fixes #60

The rollover fix for the giga used the 64 bit timer instead of 32 bits. The nano does not have a 64 bit timer, so you need to use the 32 bit instead.

So I know check to see if the processor supports 64 bits if so use it else fall back to 32 bit.

@mjs513 you might want to try this out to see if it fixes the issue for you

The rollover fix for the giga used the 64 bit timer instead of 32
bits.  The nano does not have a 64 bit timer, so you need to use
the 32 bit instead.

So I know check to see if the processor supports 64 bits if so use it
else fall back to 32 bit.
@mjs513
Copy link

mjs513 commented Jan 30, 2025

@KurtE
Looks like it fixed the micros issue on the nano:

was hanging with this function:

void clearSerialInput() {
  uint32_t m = micros();
  do {
    if (Serial.read() >= 0) {
      m = micros();
    }
  } while (micros() - m < 10000);
}

no longer hanging

SdFat version: 2.2.3

Assuming the SD is the only SPI device.
Edit DISABLE_CS_PIN to disable an SPI device.

Assuming the SD chip select pin is: 9
Edit SD_CS_PIN to change the SD chip select pin.

type any character to start

SD initialization failed.
Do not reformat the card!
Is the card correctly inserted?
Is there a wiring/soldering problem?
Is SD_CS_PIN set to the correct value?
Does another SPI device need to be disabled?
SD errorCode: SD_CARD_ERROR_INVALID_CARD_CONFIG = 0x2b
SD errorData = 0x0

type any character to start

@facchinm facchinm merged commit 7715962 into arduino:arduino Mar 5, 2025
2 of 4 checks passed
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

Successfully merging this pull request may close these issues.

Nano 33 BLE: micros() function does not work
3 participants