From d62963b4a64efe8d2917f489fefaf586a9a99126 Mon Sep 17 00:00:00 2001 From: asterix Date: Mon, 26 May 2008 17:23:07 +0000 Subject: [PATCH] Use configuration file instead appconfig. Reformat. Clean up. Remove CVS logs. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1379 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/algo/md2.h | 3 +- bertos/algo/randpool.c | 43 ++------------------------- bertos/algo/randpool.h | 2 +- bertos/cpu/attr.h | 7 +++-- bertos/cpu/avr/drv/adc_avr.c | 37 +++++++++++++++++++----- bertos/cpu/avr/drv/timer_avr.h | 53 ++++------------------------------ bertos/drv/eeprom.c | 3 +- bertos/drv/eeprom.h | 2 +- bertos/drv/flash25.c | 2 -- bertos/drv/flash25.h | 5 ++-- bertos/drv/kbd.c | 34 ++++++---------------- bertos/drv/kbd.h | 7 +++-- bertos/drv/lcd_hd44.c | 2 +- bertos/drv/lcd_hd44.h | 2 +- bertos/drv/ser.h | 2 +- bertos/drv/stepper.c | 4 +-- bertos/drv/stepper.h | 1 + bertos/drv/timer.h | 9 ++++-- bertos/drv/wdt.h | 4 +-- bertos/hw/hw_lcd.h | 5 ++-- bertos/kern/proc.h | 3 +- bertos/mware/event.h | 3 +- bertos/net/pocketbus.h | 2 +- bertos/net/xmodem.c | 8 ++--- 24 files changed, 86 insertions(+), 157 deletions(-) diff --git a/bertos/algo/md2.h b/bertos/algo/md2.h index 8d0edb79..b06e0758 100644 --- a/bertos/algo/md2.h +++ b/bertos/algo/md2.h @@ -39,7 +39,6 @@ * message having a given prespecified target message digest. * * - * * \version $Id$ * \author Daniele Basile */ @@ -47,8 +46,8 @@ #ifndef ALGO_MD2_H #define ALGO_MD2_H +#include #include -#include #define NUM_COMPUTE_ROUNDS 18 ///< Number of compute rounds. #define COMPUTE_ARRAY_LEN CONFIG_MD2_BLOCK_LEN * 3 ///< Lenght of compute array. diff --git a/bertos/algo/randpool.c b/bertos/algo/randpool.c index a32fdff4..0fc2ee9d 100644 --- a/bertos/algo/randpool.c +++ b/bertos/algo/randpool.c @@ -36,53 +36,16 @@ * \author Daniele Basile */ -/*#* - *#* $Log$ - *#* Revision 1.20 2007/06/07 16:06:39 batt - *#* Fix some doxygen errors. - *#* - *#* Revision 1.19 2007/02/15 13:54:26 asterix - *#* Rename randpool_getN in randpool_get. Fix bug in randpool_get. - *#* - *#* Revision 1.17 2007/02/15 13:40:42 asterix - *#* Fix bug in randpool_add and randpool_strir. - *#* - *#* Revision 1.16 2007/02/13 15:11:37 asterix - *#* Typo. - *#* - *#* Revision 1.14 2007/02/13 09:57:12 asterix - *#* Add directive #if in struct EntropyPool, and remove #else in randpool_add. - *#* - *#* Revision 1.13 2007/02/12 18:25:34 asterix - *#* Fix bug in randpool_getN. - *#* - *#* Revision 1.12 2007/02/12 09:47:39 asterix - *#* Remove randpool_save. Add randpool_pool. - *#* - *#* Revision 1.10 2007/02/12 09:03:32 asterix - *#* Add CONFIG_RANDPOOL_TIMER macro to swich on or off timer support - *#* - *#* Revision 1.9 2007/02/09 17:58:09 asterix - *#* Add macro CONFIG_RANDPOOL_TIMER. - *#* - *#* Revision 1.6 2007/02/09 09:24:38 asterix - *#* Typos. Add data_len in randpool_add and n_byte in randpool_push pototypes. - *#* - *#* Revision 1.3 2007/02/08 14:25:29 asterix - *#* Write static funcion push_byte. - *#* - *#*/ - #include "randpool.h" #include "md2.h" -#include //sprintf(); -#include //memset(), memcpy(); - #include #include //ASSERT() #include //MIN(), ROUND_UP(); +#include //sprintf(); +#include //memset(), memcpy(); + #if CONFIG_RANDPOOL_TIMER #include //timer_clock(); #endif diff --git a/bertos/algo/randpool.h b/bertos/algo/randpool.h index 317ebe74..fd0a96fd 100644 --- a/bertos/algo/randpool.h +++ b/bertos/algo/randpool.h @@ -40,8 +40,8 @@ #ifndef ALGO_RANDPOOL_H #define ALGO_RANDPOOL_H +#include #include -#include /** diff --git a/bertos/cpu/attr.h b/bertos/cpu/attr.h index b0ac8a4d..48d22601 100644 --- a/bertos/cpu/attr.h +++ b/bertos/cpu/attr.h @@ -42,10 +42,11 @@ #define CPU_ATTR_H #include "detect.h" -#include /* for uintXX_t */ -#include /* ARCH_EMUL */ -#include "appconfig.h" // CONFIG_FAST_MEM +#include /* CONFIG_FAST_MEM */ +#include /* for uintXX_t */ +#include /* ARCH_EMUL */ + /** * \name Macros for determining CPU endianness. diff --git a/bertos/cpu/avr/drv/adc_avr.c b/bertos/cpu/avr/drv/adc_avr.c index e57b04bf..ec131745 100644 --- a/bertos/cpu/avr/drv/adc_avr.c +++ b/bertos/cpu/avr/drv/adc_avr.c @@ -1,11 +1,34 @@ -/*! +/** * \file * * - * \version $Id$ - * * \brief ADC hardware-specific definition * * \version $Id$ @@ -14,12 +37,13 @@ #include "adc_avr.h" -#include -#include - +#include +#include #include #include +#include + #include #include @@ -29,7 +53,6 @@ #if CONFIG_KERNEL #include - #include #include #include diff --git a/bertos/cpu/avr/drv/timer_avr.h b/bertos/cpu/avr/drv/timer_avr.h index 74414263..de46d1b7 100644 --- a/bertos/cpu/avr/drv/timer_avr.h +++ b/bertos/cpu/avr/drv/timer_avr.h @@ -31,65 +31,24 @@ * * --> * + * \brief Low-level timer module for AVR (interface). + * * \version $Id$ * * \author Bernardo Innocenti * \author Francesco Sacchi * - * \brief Low-level timer module for AVR (interface). */ -/*#* - *#* $Log$ - *#* Revision 1.32 2007/10/08 12:14:32 batt - *#* Fix some review issues. - *#* - *#* Revision 1.31 2007/10/07 12:30:55 batt - *#* Add default timer for AVR. - *#* - *#* Revision 1.30 2007/06/07 14:35:12 batt - *#* Merge from project_ks. - *#* - *#* Revision 1.29 2007/03/21 11:01:36 batt - *#* Add missing support for ATMega1281. - *#* - *#* Revision 1.28 2006/07/19 12:56:26 bernie - *#* Convert to new Doxygen style. - *#* - *#* Revision 1.27 2006/05/18 00:38:24 bernie - *#* Use hw_cpu.h instead of ubiquitous hw.h. - *#* - *#* Revision 1.26 2006/02/21 21:28:02 bernie - *#* New time handling based on TIMER_TICKS_PER_SEC to support slow timers with ticks longer than 1ms. - *#* - *#* Revision 1.25 2005/07/19 07:26:37 bernie - *#* Refactor to decouple timer ticks from milliseconds. - *#* - *#* Revision 1.24 2005/04/11 19:10:28 bernie - *#* Include top-level headers from cfg/ subdir. - *#* - *#* Revision 1.23 2005/03/01 23:24:51 bernie - *#* Tweaks for avr-libc 1.2.x. - *#* - *#* Revision 1.21 2004/12/13 12:07:06 bernie - *#* DISABLE_IRQSAVE/ENABLE_IRQRESTORE: Convert to IRQ_SAVE_DISABLE/IRQ_RESTORE. - *#* - *#* Revision 1.20 2004/11/16 20:59:46 bernie - *#* Include explicitly. - *#* - *#* Revision 1.19 2004/10/19 08:56:41 bernie - *#* TIMER_STROBE_ON, TIMER_STROBE_OFF, TIMER_STROBE_INIT: Move from timer_avr.h to timer.h, where they really belong. - *#* - *#* Revision 1.18 2004/09/20 03:31:03 bernie - *#* Fix racy racy code. - *#*/ #ifndef DRV_TIMER_AVR_H #define DRV_TIMER_AVR_H -#include /* CONFIG_TIMER */ +#include "hw_cpu.h" /* CLOCK_FREQ */ + +#include /* CONFIG_TIMER */ #include /* uint8_t */ #include /* DIV_ROUND */ -#include /* CLOCK_FREQ */ + /** * \name Values for CONFIG_TIMER. diff --git a/bertos/drv/eeprom.c b/bertos/drv/eeprom.c index 250141a3..835c1cc5 100644 --- a/bertos/drv/eeprom.c +++ b/bertos/drv/eeprom.c @@ -40,11 +40,10 @@ #include "eeprom.h" +#include // CONFIG_EEPROM_VERIFY #include // MIN() #include -#include // CONFIG_EEPROM_VERIFY - #include #include CPU_HEADER(twi) diff --git a/bertos/drv/eeprom.h b/bertos/drv/eeprom.h index 20c1939d..f8233a6a 100644 --- a/bertos/drv/eeprom.h +++ b/bertos/drv/eeprom.h @@ -42,8 +42,8 @@ #ifndef DRV_EEPROM_H #define DRV_EEPROM_H +#include #include -#include /** * \name Values for CONFIG_EEPROM_TYPE diff --git a/bertos/drv/flash25.c b/bertos/drv/flash25.c index a36bbb38..529804d3 100644 --- a/bertos/drv/flash25.c +++ b/bertos/drv/flash25.c @@ -47,8 +47,6 @@ */ #include "hw_spi.h" -#include - #include #include diff --git a/bertos/drv/flash25.h b/bertos/drv/flash25.h index af940852..09579c0e 100644 --- a/bertos/drv/flash25.h +++ b/bertos/drv/flash25.h @@ -41,11 +41,10 @@ #ifndef DRV_FLASH25_H #define DRV_FLASH25_H -#include #include +#include - -#include +#include /** * Type definition for serial flash memory. diff --git a/bertos/drv/kbd.c b/bertos/drv/kbd.c index 6051f2e6..cc623c6a 100644 --- a/bertos/drv/kbd.c +++ b/bertos/drv/kbd.c @@ -41,19 +41,19 @@ * */ -#include +#include "hw_kbd.h" -#include +#include +#include +#include #include #include -#include -#include /* Configuration sanity checks */ -#if !defined(CONFIG_KBD_POLL) || (CONFIG_KBD_POLL != KBD_POLL_SOFTINT && CONFIG_KBD_POLL != CONFIG_POLL_FREERTOS) - #error CONFIG_KBD_POLL must be defined to either KBD_POLL_SOFTINT or CONFIG_POLL_FREERTOS +#if !defined(CONFIG_KBD_POLL) || (CONFIG_KBD_POLL != KBD_POLL_SOFTINT) + #error CONFIG_KBD_POLL must be defined to either KBD_POLL_SOFTINT #endif #if !defined(CONFIG_KBD_BEEP) || (CONFIG_KBD_BEEP != 0 && CONFIG_KBD_BEEP != 1) #error CONFIG_KBD_BEEP must be defined to either 0 or 1 @@ -154,19 +154,8 @@ static void kbd_softint(UNUSED_ARG(iptr_t, arg)) timer_add(&kbd_timer); } -#elif CONFIG_KBD_POLL == CONFIG_POLL_FREERTOS - -#include "FreeRTOS.h" -#include "task.h" - -static portTASK_FUNCTION(kbd_task, arg) -{ - for (;;) - { - kbd_poll(); - timer_delay(KBD_CHECK_INTERVAL); - } -} +#else + #error "Define keyboard poll method" #endif /* CONFIG_KBD_POLL */ @@ -488,14 +477,9 @@ void kbd_init(void) timer_setDelay(&kbd_timer, ms_to_ticks(KBD_CHECK_INTERVAL)); timer_add(&kbd_timer); -#elif CONFIG_KBD_POLL == CONFIG_POLL_FREERTOS - - /* Create a timer specific thread */ - xTaskCreate(kbd_task, "kbd", CONFIG_STACK_KBD, - NULL, CONFIG_PRI_KBD, NULL); - #else #error "Define keyboard poll method" + #endif MOD_INIT(kbd); diff --git a/bertos/drv/kbd.h b/bertos/drv/kbd.h index c1904716..f7348752 100644 --- a/bertos/drv/kbd.h +++ b/bertos/drv/kbd.h @@ -42,10 +42,12 @@ #ifndef DRV_KBD_H #define DRV_KBD_H -#include +#include "kbd_map.h" + +#include // CONFIG_KBD_OBSERVER #include + #include -#include // CONFIG_KBD_OBSERVER /** * \name Keyboard polling modes. @@ -55,7 +57,6 @@ * \{ */ #define KBD_POLL_SOFTINT 1 -#define KBD_POLL_FREERTOS 2 /* \} */ /** diff --git a/bertos/drv/lcd_hd44.c b/bertos/drv/lcd_hd44.c index 6b7b1568..2949bb73 100644 --- a/bertos/drv/lcd_hd44.c +++ b/bertos/drv/lcd_hd44.c @@ -39,7 +39,7 @@ #include "hw_lcd.h" -#include +#include #include #include diff --git a/bertos/drv/lcd_hd44.h b/bertos/drv/lcd_hd44.h index 0ebba974..42f149f3 100644 --- a/bertos/drv/lcd_hd44.h +++ b/bertos/drv/lcd_hd44.h @@ -40,7 +40,7 @@ #ifndef DRV_LCD_HD44_H #define DRV_LCD_HD44_H -#include +#include #include /* For stdint types */ /** diff --git a/bertos/drv/ser.h b/bertos/drv/ser.h index c0f7b8bb..239a751e 100644 --- a/bertos/drv/ser.h +++ b/bertos/drv/ser.h @@ -72,7 +72,7 @@ #include CPU_HEADER(ser) #endif -#include +#include diff --git a/bertos/drv/stepper.c b/bertos/drv/stepper.c index 39fa288f..1dd562f9 100644 --- a/bertos/drv/stepper.c +++ b/bertos/drv/stepper.c @@ -21,13 +21,13 @@ #include "hw_stepper.h" #include "hw_sensor.h" -#include "appconfig.h" - +#include #include #include #include + #include #include // memset diff --git a/bertos/drv/stepper.h b/bertos/drv/stepper.h index 5f74b9b1..10a29bce 100644 --- a/bertos/drv/stepper.h +++ b/bertos/drv/stepper.h @@ -21,6 +21,7 @@ #define DRV_STEPPER_H #include + #include // Forward declaration diff --git a/bertos/drv/timer.h b/bertos/drv/timer.h index cd7aa1b4..76f4f31f 100644 --- a/bertos/drv/timer.h +++ b/bertos/drv/timer.h @@ -31,11 +31,12 @@ * * --> * + * \brief Hardware independent timer driver (interface) + * * \version $Id$ * * \author Bernardo Innocenti * - * \brief Hardware independent timer driver (interface) */ #ifndef DRV_TIMER_H @@ -43,6 +44,7 @@ #include #include + #include #include @@ -57,10 +59,11 @@ #include CPU_HEADER(timer) #endif -#include +#include #include #include -#include + +#include extern volatile ticks_t _clock; diff --git a/bertos/drv/wdt.h b/bertos/drv/wdt.h index 1db10538..4b1e6a91 100644 --- a/bertos/drv/wdt.h +++ b/bertos/drv/wdt.h @@ -40,9 +40,9 @@ #ifndef DRV_WDT_H #define DRV_WDT_H -#include +#include #include // INLINE -#include +#include /* Configury sanity check */ #if !defined(CONFIG_WATCHDOG) || (CONFIG_WATCHDOG != 0 && CONFIG_WATCHDOG != 1) diff --git a/bertos/hw/hw_lcd.h b/bertos/hw/hw_lcd.h index a6521f40..4d63652a 100644 --- a/bertos/hw/hw_lcd.h +++ b/bertos/hw/hw_lcd.h @@ -43,9 +43,8 @@ #ifndef HW_LCD_H #define HW_LCD_H -#include - -#include /* BV() */ +#include /* CONFIG_LCD_4BIT */ +#include /* BV() */ #include #include diff --git a/bertos/kern/proc.h b/bertos/kern/proc.h index cec57487..d6109e35 100644 --- a/bertos/kern/proc.h +++ b/bertos/kern/proc.h @@ -40,9 +40,10 @@ #ifndef KERN_PROC_H #define KERN_PROC_H +#include #include + #include -#include /* Fwd decl */ struct Process; diff --git a/bertos/mware/event.h b/bertos/mware/event.h index 4270e946..5fa996c6 100644 --- a/bertos/mware/event.h +++ b/bertos/mware/event.h @@ -45,10 +45,9 @@ #define KERN_EVENT_H #include -#include +#include #if CONFIG_KERNEL - #include #if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS #include #endif diff --git a/bertos/net/pocketbus.h b/bertos/net/pocketbus.h index f67af836..eb32d563 100644 --- a/bertos/net/pocketbus.h +++ b/bertos/net/pocketbus.h @@ -39,7 +39,7 @@ #ifndef NET_POCKETBUS_H #define NET_POCKETBUS_H -#include "appconfig.h" //for CONFIG_POCKETBUS_BUFLEN +#include /* for CONFIG_POCKETBUS_BUFLEN */ #include #include diff --git a/bertos/net/xmodem.c b/bertos/net/xmodem.c index d3882483..dd1adebe 100644 --- a/bertos/net/xmodem.c +++ b/bertos/net/xmodem.c @@ -47,14 +47,14 @@ #include "xmodem.h" -#include -#include /* for memset() */ -#include -#include #include +#include +#include +#include +#include /* for memset() */ /** * \name Protocol control codes -- 2.25.1