ARMmbed / mbed-os-5-docs

Full documentation for Mbed OS 5 and 6
http://os.mbed.com/docs
98 stars 170 forks source link

Mbed OS 6 Docs | Power Optimization Tutorial contains deprecated wait_ms() #1514

Open cbusse1 opened 1 year ago

cbusse1 commented 1 year ago

Mbed OS 6 Docs | Power Optimization Tutorial contains deprecated wait_ms()

Page link

https://os.mbed.com/docs/mbed-os/v6.16/apis/power-optimization.html

Expected to find...

#include "mbed.h"

DigitalOut led(LED1);

int main() {
    while (1) {
        // blink the LED
        led = !led;
        // sleep for two seconds
        ThisThread::sleep_for(2s);
    }
}

Found

#include "mbed.h"

DigitalOut led(LED1);

int main() {
    while (1) {
        // blink the LED
        led = !led;
        // sleep for two seconds
        wait_ms(2000);
    }
}