8000 millis() depends on actual cpu freq · Issue #1289 · espressif/arduino-esp32 · GitHub
[go: up one dir, main page]

Skip to content
millis() depends on actual cpu freq #1289
Closed
@HDPWR

Description

@HDPWR

Hardware:

Board: ?Adafruit ESP32 Feather Clone?
Core Installation/update date: ?15/march/2018?
IDE name: ?Arduino IDE?
Flash Frequency: ?80Mhz?
Upload Speed: ?921600?

Description:

If I change the CPU freq then the output of millis() becomes invalid, it changes inversely proportionally with the freq. Perhaps it is a known error but I haven't see any documentation about it.

#include "soc/rtc.h"

void setup() {
rtc_clk_cpu_freq_set(RTC_CPU_FREQ_80M);
int startTime, interval;
}

void loop() {
startTime = millis();
delay(1000);
interval = millis() - startTime; // it will be 1000, but that is 3000 in real
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0