[En-Nut-Discussion] Defining NUT_HWCLK_*
Harald Kipp
harald.kipp at egnite.de
Mon Jan 19 09:28:19 CET 2009
Hi Thiago,
> That function accepts either NUT_HWCLK_CPU or NUT_HWCLK_PERIPHERAL.
> The problem is that it's only defined in timers.h with default to
> NUT_HWCLK_PERIPHERAL == NUT_HWCLK_CPU.
This is indeed strange.
> I will have to define them to be different for AVR32. Also, I will
> need a second peripheral value, because AVR32 has PBA and PBB clocks
> for peripherals and they might have different divisors, so USART can
> use one value while USB uses a different value, all based on the value
> of the main clock.
I think, include/arch/avr32/timer.h should provide something like
#define NUT_HWCLK_PERIPHERAL_A 1
#define NUT_HWCLK_PERIPHERAL_B 2
#define NUT_HWCLK_MAX 2
#define NUT_HWCLK_PERIPHERAL NUT_HWCLK_PERIPHERAL_A
assuming, that PBB is used for USB. Otherwise you may consider
#define NUT_HWCLK_PERIPHERAL NUT_HWCLK_PERIPHERAL_B
I'll look into the ARM part... ...really strange.
Harald
More information about the En-Nut-Discussion
mailing list