Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
utils.hpp
00001 #pragma once 00002 00003 #include "mbed.h" 00004 #include "mbedtls/entropy_poll.h" 00005 00006 namespace utils 00007 { 00008 unsigned entropy_seed() 00009 { 00010 unsigned seed; 00011 size_t length; 00012 00013 unsigned char* seed_bytes = reinterpret_cast<unsigned char*>(&seed); 00014 mbedtls_hardware_poll(NULL, seed_bytes, sizeof(unsigned), &length); 00015 00016 return seed; 00017 } 00018 00019 // Default time of 0.2 seconds is fine for this lab 00020 void pulse(DigitalOut& led, float t = 0.2f) 00021 { 00022 led = false; 00023 wait(t); 00024 led = true; 00025 } 00026 }
Generated on Tue Jul 12 2022 21:20:32 by
1.7.2