* Select mux channel \a ch.
* \todo only first 8 channels are selectable!
*/
-INLINE void adc_hw_select_ch(uint8_t ch)
+void adc_hw_select_ch(uint8_t ch)
{
//Disable all channels
ADC_CHDR = ADC_CH_MASK;
* If a kernel is present, preempt until convertion is complete, otherwise
* a busy wait on ADCS bit is done.
*/
-INLINE uint16_t adc_hw_read(void)
+uint16_t adc_hw_read(void)
{
ASSERT(!(ADC_SR & ADC_EOC_MASK));
/**
* Init ADC hardware.
*/
-INLINE void adc_hw_init(void)
+void adc_hw_init(void)
{
//Init ADC pins.
ADC_INIT_PINS();
do { \
} while (0)
+void adc_hw_select_ch(uint8_t ch);
+uint16_t adc_hw_read(void);
+void adc_hw_init(void);
#endif /* DRV_ADC_AT91_H */
* Select mux channel \a ch.
* \todo only first 8 channels are selectable!
*/
-INLINE void adc_hw_select_ch(uint8_t ch)
+void adc_hw_select_ch(uint8_t ch)
{
/* Set to 0 all mux registers */
ADMUX &= ~(BV(MUX4) | BV(MUX3) | BV(MUX2) | BV(MUX1) | BV(MUX0));
* If a kernel is present, preempt until convertion is complete, otherwise
* a busy wait on ADCS bit is done.
*/
-INLINE uint16_t adc_hw_read(void)
+uint16_t adc_hw_read(void)
{
// Ensure another convertion is not running.
ASSERT(!(ADCSRA & BV(ADSC)));
/**
* Init ADC hardware.
*/
-INLINE void adc_hw_init(void)
+void adc_hw_init(void)
{
/*
* Select channel 0 as default,
#ifndef DRV_ADC_AVR_H
#define DRV_ADC_AVR_H
+#include <cfg/compiler.h>
+
#define ADC_MUX_MAXCH 7
#define ADC_BITS 10
+void adc_hw_select_ch(uint8_t ch);
+uint16_t adc_hw_read(void);
+void adc_hw_init(void);
+
#endif /* DRV_ADC_AVR_H */
#include <drv/adc.h>
-#include CPU_CSOURCE(adc)
+#ifndef WIZ_AUTOGEN
+ #warning Deprecated: now you should include adc_<cpu> directly in the makefile. Remove this line and the following once done.
+ #include CPU_CSOURCE(adc)
+#else
+ #include CPU_HEADER(adc)
+#endif
#include <cfg/debug.h> // ASSERT()
#include <cfg/macros.h> // MIN()
#if OS_HOSTED
//#include OS_CSOURCE(timer)
#include <emul/timer_posix.c>
+#else
+ #ifndef WIZ_AUTOGEN
+ #warning Deprecated: now you should include timer_<cpu> directly in the makefile. Remove this line and the following once done.
+ #include CPU_CSOURCE(timer)
+ #endif
#endif
/*
at91sam7s_PREFIX = arm-none-eabi-
at91sam7s_CPPAFLAGS = -O0 -g -gdwarf-2 -g -gen-debug
-at91sam7s_CPPFLAGS = -O0 -D'ARCH=0' -D__ARM_AT91SAM7S256__ -D'CPU_FREQ=(48023000UL)' -g3 -gdwarf-2 -fverbose-asm -Iexamples/at91sam7s -Ibertos/cpu/arm
+at91sam7s_CPPFLAGS = -O0 -D'ARCH=0' -D__ARM_AT91SAM7S256__ -D'CPU_FREQ=(48023000UL)' -D'WIZ_AUTOGEN' -g3 -gdwarf-2 -fverbose-asm -Iexamples/at91sam7s -Ibertos/cpu/arm
at91sam7s_LDFLAGS = -nostartfiles -T bertos/cpu/arm/scripts/at91sam7_256_rom.ld -Wl,--no-warn-mismatch
at91sam7s_CPU = arm7tdmi
triface_PCSRC += bertos/mware/formatwr.c
-triface_CFLAGS = -O2 -D'ARCH=(ARCH_TRIFACE)' -D'CPU_FREQ=(14745600UL)' -fno-strict-aliasing -Iexamples/triface -Ibertos/cpu/avr
+triface_CFLAGS = -O2 -D'ARCH=(ARCH_TRIFACE)' -D'CPU_FREQ=(14745600UL)' -D'WIZ_AUTOGEN' -fno-strict-aliasing -Iexamples/triface -Ibertos/cpu/avr
triface_LDFLAGS = -Wl
examples/triface/boot/main.c \
bertos/cpu/avr/drv/ser_avr.c \
bertos/cpu/avr/drv/flash_avr.c \
- bertos/cpu/avr/drv/timer_avr.c \
bertos/drv/timer.c \
+ bertos/cpu/avr/drv/timer_avr.c \
bertos/drv/ser.c \
bertos/net/xmodem.c \
bertos/algo/crc.c \
bertos/mware/hex.c \
bertos/kern/kfile.c \
#
+
boot_PREFIX = avr-
-boot_CPPFLAGS = -D'ARCH=(ARCH_TRIFACE|ARCH_BOOT)' -D'CPU_FREQ=(14745600UL)' -Iexamples/triface/boot -Ibertos/cpu/avr
+
+boot_CPPFLAGS = -D'ARCH=(ARCH_TRIFACE|ARCH_BOOT)' -D'CPU_FREQ=(14745600UL)' -D'WIZ_AUTOGEN' -Iexamples/triface/boot -Ibertos/cpu/avr
boot_CFLAGS = -Os -mcall-prologues
boot_LDFLAGS = -Wl,--relax -Wl,--section-start=.text=$(BOOT_ADDR_START)