#ifndef DRV_ADC_AT91_H
#define DRV_ADC_AT91_H
-#include "hw/hw_cpu.h"
+#include <hw/hw_cpufreq.h>
#include "cfg/cfg_adc.h"
* Macro for computing correct value to write into ADC
* register.
*/
-#define ADC_COMPUTED_PRESCALER ((CLOCK_FREQ/(2 * CONFIG_ADC_CLOCK)) - 1)
+#define ADC_COMPUTED_PRESCALER ((CPU_FREQ/(2 * CONFIG_ADC_CLOCK)) - 1)
#define ADC_COMPUTED_STARTUPTIME (((CONFIG_ADC_STARTUP_TIME * CONFIG_ADC_CLOCK)/ 8000000UL) - 1)
#define ADC_COMPUTED_SHTIME (((CONFIG_ADC_SHTIME * CONFIG_ADC_CLOCK)/1000000000UL) - 1)
*/
#include "kdebug_at91.h"
-#include "hw/hw_cpu.h" /* for CLOCK_FREQ */
+#include <hw/hw_cpufreq.h> /* for CPU_FREQ */
#include "hw/hw_ser.h" /* Required for bus macros overrides */
#include "cfg/cfg_debug.h"
/* Reset DBGU */
DBGU_CR = BV(US_RSTRX) | BV(US_RSTTX) | BV(US_RXDIS) | BV(US_TXDIS);
/* Set baudrate */
- DBGU_BRGR = DIV_ROUND(CLOCK_FREQ, 16 * CONFIG_KDEBUG_BAUDRATE);
+ DBGU_BRGR = DIV_ROUND(CPU_FREQ, 16 * CONFIG_KDEBUG_BAUDRATE);
/* Set DBGU mode to 8 data bits, no parity and 1 stop bit. */
DBGU_MR = US_CHMODE_NORMAL | US_CHRL_8 | US_PAR_NO | US_NBSTOP_1;
/* Enable DBGU transmitter. */
#include "pwm_at91.h"
#include "hw/pwm_map.h"
-#include "hw/hw_cpu.h"
+#include <hw/hw_cpufreq.h>
#include "cfg/cfg_pwm.h"
// Define logging setting (for cfg/log.h module).
for(int i = 0; i <= PWM_HW_MAX_PRESCALER_STEP; i++)
{
- period = CLOCK_FREQ / (BV(i) * freq);
+ period = CPU_FREQ / (BV(i) * freq);
// LOG_INFO("period[%ld], prescale[%d]\n", period, i);
if ((period < PWM_HW_MAX_PERIOD) && (period != 0))
{
*/
#include "hw/hw_ser.h" /* Required for bus macros overrides */
-#include "hw/hw_cpu.h" /* CLOCK_FREQ */
+#include <hw/hw_cpufreq.h> /* CPU_FREQ */
#include "cfg/cfg_ser.h"
#include <cfg/debug.h>
static void uart0_setbaudrate(UNUSED_ARG(struct SerialHardware *, _hw), unsigned long rate)
{
/* Compute baud-rate period */
- US0_BRGR = CLOCK_FREQ / (16 * rate);
+ US0_BRGR = CPU_FREQ / (16 * rate);
//DB(kprintf("uart0_setbaudrate(rate=%lu): period=%d\n", rate, period);)
}
static void uart1_setbaudrate(UNUSED_ARG(struct SerialHardware *, _hw), unsigned long rate)
{
/* Compute baud-rate period */
- US1_BRGR = CLOCK_FREQ / (16 * rate);
+ US1_BRGR = CPU_FREQ / (16 * rate);
//DB(kprintf("uart0_setbaudrate(rate=%lu): period=%d\n", rate, period);)
}
{
SPI0_CSR0 &= ~SPI_SCBR;
- ASSERT((uint8_t)DIV_ROUND(CLOCK_FREQ, rate));
- SPI0_CSR0 |= DIV_ROUND(CLOCK_FREQ, rate) << SPI_SCBR_SHIFT;
+ ASSERT((uint8_t)DIV_ROUND(CPU_FREQ, rate));
+ SPI0_CSR0 |= DIV_ROUND(CPU_FREQ, rate) << SPI_SCBR_SHIFT;
}
#if CPU_ARM_AT91SAM7X128 || CPU_ARM_AT91SAM7X256
{
SPI1_CSR0 &= ~SPI_SCBR;
- ASSERT((uint8_t)DIV_ROUND(CLOCK_FREQ, rate));
- SPI1_CSR0 |= DIV_ROUND(CLOCK_FREQ, rate) << SPI_SCBR_SHIFT;
+ ASSERT((uint8_t)DIV_ROUND(CPU_FREQ, rate));
+ SPI1_CSR0 |= DIV_ROUND(CPU_FREQ, rate) << SPI_SCBR_SHIFT;
}
#endif
#ifndef DRV_AT91_TIMER_H
#define DRV_AT91_TIMER_H
-#include "hw/hw_cpu.h" /* CLOCK_FREQ */
+#include <hw/hw_cpufreq.h> /* CPU_FREQ */
#include "cfg/cfg_timer.h" /* CONFIG_TIMER */
#include <cfg/compiler.h> /* uint8_t */
#define DEFINE_TIMER_ISR void timer_handler(void)
#define TIMER_TICKS_PER_SEC 1000
- #define TIMER_HW_CNT (CLOCK_FREQ / (16 * TIMER_TICKS_PER_SEC) - 1)
+ #define TIMER_HW_CNT (CPU_FREQ / (16 * TIMER_TICKS_PER_SEC) - 1)
/** Frequency of the hardware high-precision timer. */
- #define TIMER_HW_HPTICKS_PER_SEC (CLOCK_FREQ / 16)
+ #define TIMER_HW_HPTICKS_PER_SEC (CPU_FREQ / 16)
/// Type of time expressed in ticks of the hardware high-precision timer
typedef uint32_t hptime_t;
* Only CLDIV is computed since CLDIV = CHDIV (50% duty cycle)
*/
uint16_t cldiv, ckdiv = 0;
- while ((cldiv = ((CLOCK_FREQ / (2 * CONFIG_I2C_FREQ)) - 3) / (1 << ckdiv)) > 255)
+ while ((cldiv = ((CPU_FREQ / (2 * CONFIG_I2C_FREQ)) - 3) / (1 << ckdiv)) > 255)
ckdiv++;
/* Atmel errata states that ckdiv *must* be less than 5 for unknown reason */
*
*/
-#include "hw/hw_cpu.h"
#include <cpu/detect.h>
#include "cfg/cfg_arch.h"
-#if CLOCK_FREQ != 48023000L
+#if CPU_FREQ != 48023000L
/* Avoid errors on nightly test */
#if !defined(ARCH_NIGHTTEST) || !(ARCH & ARCH_NIGHTTEST)
#error Clock registers set for 48MHz operation, revise following code if you want a different clock.
* \author Bernie Innocenti <bernie@codewiz.org>
*/
-#include "hw/hw_cpu.h" /* CLOCK_FREQ */
+#include <hw/hw_cpufreq.h> /* CPU_FREQ */
#include "cfg/cfg_i2c.h"
/*
* Set speed:
- * F = CLOCK_FREQ / (16 + 2*TWBR * 4^TWPS)
+ * F = CPU_FREQ / (16 + 2*TWBR * 4^TWPS)
*/
#ifndef CONFIG_I2C_FREQ
#warning Using default value of 300000L for CONFIG_I2C_FREQ
#endif
#define TWI_PRESC 1 /* 4 ^ TWPS */
- TWBR = (CLOCK_FREQ / (2 * CONFIG_I2C_FREQ * TWI_PRESC)) - (8 / TWI_PRESC);
+ TWBR = (CPU_FREQ / (2 * CONFIG_I2C_FREQ * TWI_PRESC)) - (8 / TWI_PRESC);
TWSR = 0;
TWCR = BV(TWEN);
);
* \author Francesco Sacchi <batt@develer.com>
*/
-#include "hw/hw_cpu.h" /* for CLOCK_FREQ */
+#include <hw/hw_cpufreq.h> /* for CPU_FREQ */
#include "hw/hw_ser.h" /* Required for bus macros overrides */
#include "cfg/cfg_debug.h"
#define KDBG_RESTORE_IRQ(old) do { IRQ_RESTORE((old)); } while(0)
typedef cpu_flags_t kdbg_irqsave_t;
- #define KDBG_DELAY (((CLOCK_FREQ + CONFIG_KDEBUG_BAUDRATE / 2) / CONFIG_KDEBUG_BAUDRATE) + 7) / 14
+ #define KDBG_DELAY (((CPU_FREQ + CONFIG_KDEBUG_BAUDRATE / 2) / CONFIG_KDEBUG_BAUDRATE) + 7) / 14
static void _kdebug_bitbang_delay(void)
{
SER_BITBANG_INIT;
#else /* CONFIG_KDEBUG_PORT != 666 */
/* Compute the baud rate */
- uint16_t period = DIV_ROUND(CLOCK_FREQ / 16UL, CONFIG_KDEBUG_BAUDRATE) - 1;
+ uint16_t period = DIV_ROUND(CPU_FREQ / 16UL, CONFIG_KDEBUG_BAUDRATE) - 1;
#if (CPU_AVR_ATMEGA64 || CPU_AVR_ATMEGA128 || CPU_AVR_ATMEGA1281)
#if CONFIG_KDEBUG_PORT == 0
#include "pwm_avr.h"
-#include "hw/hw_cpu.h"
+#include <hw/hw_cpufreq.h>
#warning TODO:This is an exmple of implementation of PWM low level channel for AVR, implemnt it!
*/
#include "hw/hw_ser.h" /* Required for bus macros overrides */
-#include "hw/hw_cpu.h" /* CLOCK_FREQ */
+#include <hw/hw_cpufreq.h> /* CPU_FREQ */
#include "cfg/cfg_ser.h"
static void uart0_setbaudrate(UNUSED_ARG(struct SerialHardware *, _hw), unsigned long rate)
{
/* Compute baud-rate period */
- uint16_t period = DIV_ROUND(CLOCK_FREQ / 16UL, rate) - 1;
+ uint16_t period = DIV_ROUND(CPU_FREQ / 16UL, rate) - 1;
#if !CPU_AVR_ATMEGA103
UBRR0H = (period) >> 8;
static void uart1_setbaudrate(UNUSED_ARG(struct SerialHardware *, _hw), unsigned long rate)
{
/* Compute baud-rate period */
- uint16_t period = DIV_ROUND(CLOCK_FREQ / 16UL, rate) - 1;
+ uint16_t period = DIV_ROUND(CPU_FREQ / 16UL, rate) - 1;
UBRR1H = (period) >> 8;
UBRR1L = (period);
#include <cfg/compiler.h>
#include <appconfig.h>
#include <cfg/macros.h> /* BV() */
-#include "hw/hw_cpu.h"
+#include <hw/hw_cpufreq.h>
#include <avr/io.h>
void _ser_setbaudrate(unsigned long rate)
{
/* Compute baud-rate period */
- uint16_t period = DIV_ROUND(CLOCK_FREQ / 16UL, rate) - 1;
+ uint16_t period = DIV_ROUND(CPU_FREQ / 16UL, rate) - 1;
UBRR0H = (period) >> 8;
UBRR0L = (period);
#ifndef DRV_TIMER_AVR_H
#define DRV_TIMER_AVR_H
-#include "hw/hw_cpu.h" /* CLOCK_FREQ */
+#include <hw/hw_cpufreq.h> /* CPU_FREQ */
#include "cfg/cfg_timer.h" /* CONFIG_TIMER */
#include <cfg/compiler.h> /* uint8_t */
/** Frequency of the hardware high precision timer. */
-#define TIMER_HW_HPTICKS_PER_SEC DIV_ROUND(CLOCK_FREQ, TIMER_PRESCALER)
+#define TIMER_HW_HPTICKS_PER_SEC DIV_ROUND(CPU_FREQ, TIMER_PRESCALER)
/**
* System timer: additional division after the prescaler
* 12288000 / 64 / 192 (0..191) = 1 ms
*/
-#define OCR_DIVISOR (DIV_ROUND(DIV_ROUND(CLOCK_FREQ, TIMER_PRESCALER), TIMER_TICKS_PER_SEC) - 1)
+#define OCR_DIVISOR (DIV_ROUND(DIV_ROUND(CPU_FREQ, TIMER_PRESCALER), TIMER_TICKS_PER_SEC) - 1)
/** Not needed, IRQ timer flag cleared automatically */
#define timer_hw_irq() do {} while (0)
#warning FIXME:This module is obsolete, yuo must refactor it.
#if 0
-#include "hw/hw_cpu.h"
+#include <hw/hw_cpufreq.h>
#include "timer_simple_avr.h"
#include <drv/wdt.h>
#include <cfg/compiler.h>
#include <cfg/macros.h> /* BV() */
-#include <hw_cpu.h> /* CLOCK_FREQ */
#include <avr/io.h>
#define MS_PER_SEC 1000UL
#define TIMER_PRESCALER 64UL
-#define TIMER_DELAY_1MS (255 - CLOCK_FREQ / TIMER_PRESCALER / MS_PER_SEC)
+#define TIMER_DELAY_1MS (255 - CPU_FREQ / TIMER_PRESCALER / MS_PER_SEC)
/**
* Wait \a time ms using timer 0.
#include <cfg/debug.h>
#include <cfg/macros.h> /* for BV() */
#include <appconfig.h>
-#include <hw_cpu.h> /* for CLOCK_FREQ */
+#include <hw/hw_cpufreq.h> /* for CPU_FREQ */
#include <hw_ser.h> /* Required for bus macros overrides */
static void ser_setbaudrate(unsigned long rate)
{
// Calcola il periodo per la generazione del baud rate richiesto
- uint16_t baud = (uint16_t)(((CLOCK_FREQ / 16) / rate) - 1) | 0x8000;
+ uint16_t baud = (uint16_t)(((CPU_FREQ / 16) / rate) - 1) | 0x8000;
BAUD_RATE = (uint8_t)baud;
BAUD_RATE = (uint8_t)(baud >> 8);
}
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2006, 2008 Develer S.r.l. (http://www.develer.com/)
- * All Rights Reserved.
- * -->
- *
- * \brief Hardware-specific definitions
- *
- * \version $Id$
- *
- * \author Bernie Innocenti <bernie@codewiz.org>
- */
-
-#ifndef HW_CPU_H
-#define HW_CPU_H
-
-#warning TODO:This is an example implementation, you must implement it!
-
-/// CPU Clock frequency
-#define CLOCK_FREQ (12288000UL/* Implement me! */)
-
-
-/* Timer IRQ strobe */
-//#if CONFIG_TIMER_STROBE
-// #define TIMER_STROBE_ON /* Implement me! */
-// #define TIMER_STROBE_OFF /* Implement me! */
-// #define TIMER_STROBE_INIT /* Implement me! */
-//#endif /* CONFIG_TIMER_STROBE */
-
-#endif /* HW_CPU_H */
--- /dev/null
+/**
+ * \file
+ * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
+ * Copyright 2006, 2008 Develer S.r.l. (http://www.develer.com/)
+ * All Rights Reserved.
+ * -->
+ *
+ * \brief Hardware-specific definitions
+ *
+ * \version $Id$
+ *
+ * \author Francesco Sacchi <bernie@codewiz.org>
+ */
+
+#ifndef HW_CPUFREQ_H
+#define HW_CPUFREQ_H
+
+#ifndef CPU_FREQ
+ #warning CPU_FREQ is not defined, you should upgrade to the new clock frequency defining method.
+
+ /*
+ * This is DEPRECATED file, it will be removed in the next major release.
+ * We have set up a new cpu frequency definition method.
+ * The new macro CPU_FREQ should be defined as a compiler flag in the
+ * makefile instead of the old CLOCK_FREQ macro. With new projects you should only
+ * use the CPU_FREQ macro.
+ *
+ * With gcc you should add something like this:
+ *
+ * -D'CPU_FREQ=(12288000UL)'
+ *
+ * For backward compatibility the old method is still supported.
+ */
+ #include "hw/hw_cpu.h"
+
+ #define CPU_FREQ (CLOCK_FREQ)
+#endif /* CPU_FREQ */
+
+#endif /* HW_CPUFREQ_H */
#ifndef HW_STEPPER_H
#define HW_STEPPER_H
-#include "hw/hw_cpu.h"
+#include <hw/hw_cpufreq.h>
#include <cfg/macros.h>
/**
* Stepper timer clock frequency.
*/
-#define STEPPER_CLOCK ((CLOCK_FREQ) >> STEPPER_PRESCALER_LOG2)
+#define STEPPER_CLOCK ((CPU_FREQ) >> STEPPER_PRESCALER_LOG2)
/**
* us delay to reset a stepper motor.
at91sam7s_PREFIX = arm-none-eabi-
at91sam7s_CPPAFLAGS = -O0 -g -gdwarf-2 -g -gen-debug
-at91sam7s_CPPFLAGS = -O0 -D'ARCH=0' -D__ARM_AT91SAM7S256__ -g3 -gdwarf-2 -fverbose-asm -Iexamples/at91sam7s/hw -Iexamples/at91sam7s -Ibertos/cpu/arm
+at91sam7s_CPPFLAGS = -O0 -D'ARCH=0' -D__ARM_AT91SAM7S256__ -D'CPU_FREQ=(48023000UL)' -g3 -gdwarf-2 -fverbose-asm -Iexamples/at91sam7s/hw -Iexamples/at91sam7s -Ibertos/cpu/arm
at91sam7s_LDFLAGS = -nostartfiles -T bertos/cpu/arm/scripts/at91sam7_256_ram.ld -Wl,--no-warn-mismatch
at91sam7s_CPU = arm7tdmi
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2006 Develer S.r.l. (http://www.develer.com/)
- * All Rights Reserved.
- * -->
- *
- * \brief Hardware-specific definitions
- *
- * \version $Id$
- *
- * \author Bernie Innocenti <bernie@codewiz.org>
- */
-
-/*#*
- *#* $Log$
- *#* Revision 1.1 2006/05/18 00:41:47 bernie
- *#* New triface devlib application.
- *#*
- *#*/
-
-#ifndef AT91SAM7SEK_HW_H
-#define AT91SAM7SEK_HW_H
-
-/// CPU Clock frequency (48.023 MHz)
-#define CLOCK_FREQ (48023000UL)
-
-
-/* Timer IRQ strobe */
-//#if CONFIG_TIMER_STROBE
-// #define TIMER_STROBE_ON ATOMIC(PORTD |= BV(PD0))
-// #define TIMER_STROBE_OFF ATOMIC(PORTD &= ~BV(PD0))
-// #define TIMER_STROBE_INIT ATOMIC(PORTD &= ~BV(PD0); DDRD |= BV(PD0))
-//#endif /* CONFIG_TIMER_STROBE */
-
-#endif /* AT91SAM7SEK_HW_H */
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2006, 2008 Develer S.r.l. (http://www.develer.com/)
- * All Rights Reserved.
- * -->
- *
- * \brief Hardware-specific definitions
- *
- * \version $Id$
- *
- * \author Bernie Innocenti <bernie@codewiz.org>
- */
-
-#ifndef HW_CPU_H
-#define HW_CPU_H
-
-#warning TODO:This is an example implementation, you must implement it!
-
-/// CPU Clock frequency
-#define CLOCK_FREQ (48023000L/* Implement me! */)
-
-
-/* Timer IRQ strobe */
-//#if CONFIG_TIMER_STROBE
-// #define TIMER_STROBE_ON /* Implement me! */
-// #define TIMER_STROBE_OFF /* Implement me! */
-// #define TIMER_STROBE_INIT /* Implement me! */
-//#endif /* CONFIG_TIMER_STROBE */
-
-#endif /* HW_CPU_H */
lm3s1968_PREFIX = arm-none-eabi-
lm3s1968_CPPAFLAGS = -O0 -g -gdwarf-2 -g -gen-debug -mthumb
-lm3s1968_CPPFLAGS = -O0 -D'ARCH=0' -D__ARM_LM3S1968__ -g3 -gdwarf-2 -fverbose-asm -mthumb -Iexamples/lm3s1968 -Ibertos/cpu/cortex-m3
+lm3s1968_CPPFLAGS = -O0 -D'ARCH=0' -D__ARM_LM3S1968__ -D'CPU_FREQ=(48023000L)' -g3 -gdwarf-2 -fverbose-asm -mthumb -Iexamples/lm3s1968 -Ibertos/cpu/cortex-m3
lm3s1968_LDFLAGS = -nostartfiles -T examples/lm3s1968/standalone.ld -Wl,--no-warn-mismatch
lm3s1968_CPU = cortex-m3
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2003, 2004, 2006 Develer S.r.l. (http://www.develer.com/)
- * Copyright 2000 Bernie Innocenti <bernie@codewiz.org>
- *
- * --> Rights Reserved.
- *
- * \brief Hardware-specific definitions
- *
- * \version $Id$
- *
- * \author Bernie Innocenti <bernie@codewiz.org>
- */
-
-#ifndef TRIFACE_HW_H
-#define TRIFACE_HW_H
-
-/// CPU Clock frequency (14.7456 MHz)
-#define CLOCK_FREQ (14745600UL)
-
-
-/* Timer IRQ strobe */
-//#if CONFIG_TIMER_STROBE
-// #define TIMER_STROBE_ON ATOMIC(PORTD |= BV(PD0))
-// #define TIMER_STROBE_OFF ATOMIC(PORTD &= ~BV(PD0))
-// #define TIMER_STROBE_INIT ATOMIC(PORTD &= ~BV(PD0); DDRD |= BV(PD0))
-//#endif /* CONFIG_TIMER_STROBE */
-
-#endif /* TRIFACE_HW_H */
-
+++ /dev/null
-/**
- * \file
- * <!--
- * This file is part of BeRTOS.
- *
- * Bertos is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * As a special exception, you may use this file as part of a free software
- * library without restriction. Specifically, if other files instantiate
- * templates or use macros or inline functions from this file, or you compile
- * this file and link it with other files to produce an executable, this
- * file does not by itself cause the resulting executable to be covered by
- * the GNU General Public License. This exception does not however
- * invalidate any other reasons why the executable file might be covered by
- * the GNU General Public License.
- *
- * Copyright 2003, 2004, 2006 Develer S.r.l. (http://www.develer.com/)
- * Copyright 2000 Bernie Innocenti <bernie@codewiz.org>
- *
- * --> Rights Reserved.
- *
- * \brief Hardware-specific definitions
- *
- * \version $Id$
- *
- * \author Bernie Innocenti <bernie@codewiz.org>
- */
-
-#ifndef TRIFACE_HW_H
-#define TRIFACE_HW_H
-
-/// CPU Clock frequency (14.7456 MHz)
-#define CLOCK_FREQ (14745600UL)
-
-
-/* Timer IRQ strobe */
-//#if CONFIG_TIMER_STROBE
-// #define TIMER_STROBE_ON ATOMIC(PORTD |= BV(PD0))
-// #define TIMER_STROBE_OFF ATOMIC(PORTD &= ~BV(PD0))
-// #define TIMER_STROBE_INIT ATOMIC(PORTD &= ~BV(PD0); DDRD |= BV(PD0))
-//#endif /* CONFIG_TIMER_STROBE */
-
-#endif /* TRIFACE_HW_H */
-
triface_PCSRC += bertos/mware/formatwr.c
-triface_CFLAGS = -O2 -D'ARCH=(ARCH_TRIFACE)' -fno-strict-aliasing -Iexamples/triface -Ibertos/cpu/avr
+triface_CFLAGS = -O2 -D'ARCH=(ARCH_TRIFACE)' -D'CPU_FREQ=(14745600UL)' -fno-strict-aliasing -Iexamples/triface -Ibertos/cpu/avr
triface_LDFLAGS = -Wl
bertos/kern/kfile.c \
#
boot_PREFIX = avr-
-boot_CPPFLAGS = -D'ARCH=(ARCH_TRIFACE|ARCH_BOOT)' -Iexamples/triface/boot -Ibertos/cpu/avr
+boot_CPPFLAGS = -D'ARCH=(ARCH_TRIFACE|ARCH_BOOT)' -D'CPU_FREQ=(14745600UL)' -Iexamples/triface/boot -Ibertos/cpu/avr
boot_CFLAGS = -Os -mcall-prologues
boot_LDFLAGS = -Wl,--relax -Wl,--section-start=.text=$(BOOT_ADDR_START)
$pname_CFLAGS = $cflags
$pname_LDFLAGS = $ldflags
$pname_CPPFLAGS = $cppflags
-$pname_CPPAFLAGS = $cppaflags
+$pname_CPPAFLAGS = -D'CPU_FREQ=($cpuclockfreq)' $cppaflags
$pname_CXXFLAGS = $cxxflags
$pname_ASFLAGS = $asflags
$pname_ARFLAGS = $arflags