I'm building something that will mostly run on bare ATmega328p at 8 MHz (as described eg. here), but sometimes I need to run the same code on an Arduino.
I need to initialize the DHT library depending on the clock frequency. For simplicity, I'd rather detect the running environment runtime, in the program itself.
So, is there a straightforward way to detect the clock speed (from fuses?) or some other difference between a stock UNO board and a bare ATmega328p using the internal 8 MHz clock?