Files
toaster/fw/stm8s/common/inc/clock.h

21 lines
341 B
C
Raw Normal View History

2026-02-13 20:30:52 +00:00
#ifndef CLOCK_H
#define CLOCK_H
#ifndef F_CPU
#warning "F_CPU not defined, using 2MHz by default"
#define F_CPU 16000000UL
#endif
#include <stdint.h>
#include "stm8s.h"
inline void clock_init(void)
{
#if (F_CPU == 2000000UL)
#elif (F_CPU == 16000000UL)
CLK_CKDIVR = 0x00; // Set the frequency to 16 MHz
#endif
}
#endif /* CLOCK_H */