From 37efb5bdc0504ab6df2e8db0635c9c6f7477e23e Mon Sep 17 00:00:00 2001 From: duplo Date: Mon, 16 Feb 2009 10:02:32 +0000 Subject: [PATCH] Change the comment style for the modules and the list, and use the newParser to parse them git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2346 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/algo/crc.h | 6 +----- bertos/algo/md2.h | 7 ++---- bertos/algo/pid_control.h | 7 ++---- bertos/algo/ramp.h | 7 ++---- bertos/algo/randpool.h | 8 +++---- bertos/algo/rle.h | 6 +----- bertos/algo/rotating_hash.h | 6 +----- bertos/algo/tea.h | 6 +----- bertos/cfg/cfg_timer.h | 3 ++- bertos/cfg/log.h | 10 ++++----- bertos/cpu/avr/drv/ser_avr.h | 7 +++--- bertos/drv/adc.h | 7 ++---- bertos/drv/dataflash.h | 7 +++--- bertos/drv/dc_motor.h | 8 +++---- bertos/drv/eeprom.h | 7 ++---- bertos/drv/flash25.h | 12 ++++------- bertos/drv/ft245rl.h | 7 ++---- bertos/drv/i2c.h | 10 +++------ bertos/drv/ntc.h | 7 ++---- bertos/drv/pcf8574.h | 7 ++---- bertos/drv/phase.h | 7 +++--- bertos/drv/pwm.h | 7 ++---- bertos/drv/ser.h | 12 ++++------- bertos/drv/spi_bitbang.h | 11 +++------- bertos/drv/stepper.h | 7 +++--- bertos/drv/thermo.h | 7 +++--- bertos/drv/timer.h | 7 ++---- bertos/drv/wdt.h | 7 ++---- bertos/kern/kfile.h | 7 ++---- bertos/kern/proc.h | 7 ++---- bertos/net/pocketbus.h | 8 +++---- bertos/net/pocketcmd.h | 7 ++---- bertos/net/xmodem.h | 8 +++---- wizard/bertos_utils.py | 42 ++++++++++++++++++++++++++++++++++++ wizard/newParser.py | 13 ++++++++--- 35 files changed, 131 insertions(+), 171 deletions(-) diff --git a/bertos/algo/crc.h b/bertos/algo/crc.h index 51ce4dd0..be8f0df8 100644 --- a/bertos/algo/crc.h +++ b/bertos/algo/crc.h @@ -46,11 +46,7 @@ * \version $Id$ * \author Bernie Innocenti * - * $WIZARD_MODULE = { - * "name" : "crc16", - * "depends" : [], - * "configuration" : "" - * } + * $WIZ$ module_name = "crc16" */ #ifndef ALGO_CRC_H diff --git a/bertos/algo/md2.h b/bertos/algo/md2.h index bce2947c..6ddc9513 100644 --- a/bertos/algo/md2.h +++ b/bertos/algo/md2.h @@ -42,11 +42,8 @@ * \version $Id$ * \author Daniele Basile * - * $WIZARD_MODULE = { - * "name" : "md2", - * "depends" : [], - * "configuration" : "bertos/cfg/cfg_md2.h" - * } + * $WIZ$ module_name = "md2" + * $WIZ$ module_configuration = "bertos/cfg/cfg_md2.h" */ #ifndef ALGO_MD2_H diff --git a/bertos/algo/pid_control.h b/bertos/algo/pid_control.h index 1aa56d68..ead5faa7 100644 --- a/bertos/algo/pid_control.h +++ b/bertos/algo/pid_control.h @@ -36,11 +36,8 @@ * * \author Daniele Basile * - * $WIZARD_MODULE = { - * "name" : "pid_control", - * "depends" : ["timer"], - * "configuration" : "" - * } + * $WIZ$ module_name = "pid_control" + * $WIZ$ module_depends = "timer" */ #ifndef ALGO_PID_CONTROL_H diff --git a/bertos/algo/ramp.h b/bertos/algo/ramp.h index 1ca7bb76..6ec37c8c 100644 --- a/bertos/algo/ramp.h +++ b/bertos/algo/ramp.h @@ -43,11 +43,8 @@ * \author Giovanni Bajo * \author Daniele Basile * - * $WIZARD_MODULE = { - * "name" : "ramp", - * "depends" : [], - * "configuration" : "bertos/cfg/cfg_ramp.h" - * } + * $WIZ$ module_name = "ramp" + * $WIZ$ module_configuration = "bertos/cfg/cfg_ramp.h" */ #ifndef ALGO_RAMP_H diff --git a/bertos/algo/randpool.h b/bertos/algo/randpool.h index fe999e32..6e6a7dba 100644 --- a/bertos/algo/randpool.h +++ b/bertos/algo/randpool.h @@ -36,11 +36,9 @@ * \version $Id$ * \author Daniele Basile * - * $WIZARD_MODULE = { - * "name" : "randpool", - * "depends" : ["timer"], - * "configuration" : "bertos/cfg/cfg_randpool.h" - * } + * $WIZ$ module_name = "randpool" + * $WIZ$ module_depends = "timer" + * $WIZ$ module_configuration = "bertos/cfg/cfg_randpool.h" */ #ifndef ALGO_RANDPOOL_H diff --git a/bertos/algo/rle.h b/bertos/algo/rle.h index 382f9079..7cb34b1b 100644 --- a/bertos/algo/rle.h +++ b/bertos/algo/rle.h @@ -36,11 +36,7 @@ * \version $Id$ * \author Bernie Innocenti * - * $WIZARD_MODULE = { - * "name" : "rle", - * "depends" : [], - * "configuration" : "" - * } + * $WIZ$ module_name = "rle" */ #ifndef RLE_H #define RLE_H diff --git a/bertos/algo/rotating_hash.h b/bertos/algo/rotating_hash.h index c0d3d9b5..1280569b 100644 --- a/bertos/algo/rotating_hash.h +++ b/bertos/algo/rotating_hash.h @@ -41,11 +41,7 @@ * * \author Francesco Sacchi * - * $WIZARD_MODULE = { - * "name" : "rotating_hash", - * "depends" : [], - * "configuration" : "" - * } + * $WIZ$ module_name = "rotating_hash" */ diff --git a/bertos/algo/tea.h b/bertos/algo/tea.h index 72ea01f0..712a4ea9 100644 --- a/bertos/algo/tea.h +++ b/bertos/algo/tea.h @@ -38,11 +38,7 @@ * \version $Id$ * \author Francesco Sacchi * - * $WIZARD_MODULE = { - * "name" : "tea", - * "depends" : [], - * "configuration" : "" - * } + * $WIZ$ module_name = "tea" */ #ifndef ALGO_TEA_H diff --git a/bertos/cfg/cfg_timer.h b/bertos/cfg/cfg_timer.h index 7ed19558..5262f80d 100644 --- a/bertos/cfg/cfg_timer.h +++ b/bertos/cfg/cfg_timer.h @@ -35,6 +35,7 @@ * \version $Id$ * * \author Daniele Basile + * $WIZ$ */ #ifndef CFG_TIMER_H @@ -42,7 +43,7 @@ /** * - * $WIZARD_LIST = { "timer_select" : ["TIMER_DEFAULT"] } + * $WIZ$ timer_select = "TIMER_DEFAULT" */ /// Hardware timer selection for drv/timer.c. $WIZARD = { "type" : "enum", "value_list" : "timer_select" } diff --git a/bertos/cfg/log.h b/bertos/cfg/log.h index 444c1d73..9318697d 100644 --- a/bertos/cfg/log.h +++ b/bertos/cfg/log.h @@ -85,7 +85,8 @@ * * \version $Id$ * \author Daniele Basile - * + * + * $WIZ$ */ #ifndef CFG_LOG_H @@ -114,8 +115,7 @@ * The priority level go from error (highest) to info (lowest) (see cfg/debug.h * for more detail). * - * $WIZARD_LIST = { - * "log_level" : ["LOG_LVL_NONE", "LOG_LVL_ERR", "LOG_LVL_WARN", "LOG_LVL_INFO"] + * $WIZ$ log_level = "LOG_LVL_NONE", "LOG_LVL_ERR", "LOG_LVL_WARN", "LOG_LVL_INFO" * } */ #define LOG_LVL_NONE 0 @@ -129,9 +129,7 @@ * There are two logging format: terse and verbose. The latter prepends * function names and line number information to each log entry. * - * $WIZARD_LIST = { - * "log_format" : ["LOG_FMT_VERBOSE", "LOG_FMT_TERSE"] - * } + * $WIZ$ log_format = "LOG_FMT_VERBOSE", "LOG_FMT_TERSE" */ #define LOG_FMT_VERBOSE 1 #define LOG_FMT_TERSE 0 diff --git a/bertos/cpu/avr/drv/ser_avr.h b/bertos/cpu/avr/drv/ser_avr.h index 237c3040..90791e4f 100644 --- a/bertos/cpu/avr/drv/ser_avr.h +++ b/bertos/cpu/avr/drv/ser_avr.h @@ -35,6 +35,7 @@ * \author Daniele Basile * * \brief Low-level serial module for AVR (interface). + * */ #ifndef DRV_SER_AVR_H @@ -63,8 +64,7 @@ typedef uint8_t serstatus_t; /** * SPI clock polarity. * - * $WIZARD_LIST = { - * "ser_spi_pol" : ["SPI_NORMAL_LOW", "SPI_NORMAL_HIGH"] + * $WIZ$ ser_spi_pol = "SPI_NORMAL_LOW", "SPI_NORMAL_HIGH" * } */ #define SPI_NORMAL_LOW 0 @@ -73,8 +73,7 @@ typedef uint8_t serstatus_t; /** * SPI clock phase. * - * $WIZARD_LIST = { - * "ser_spi_phase": ["SPI_SAMPLE_ON_FIRST_EDGE", "SPI_SAMPLE_ON_SECOND_EDGE"] + * $WIZ$ ser_spi_phase = "SPI_SAMPLE_ON_FIRST_EDGE", "SPI_SAMPLE_ON_SECOND_EDGE" * } */ #define SPI_SAMPLE_ON_FIRST_EDGE 0 diff --git a/bertos/drv/adc.h b/bertos/drv/adc.h index d1b8b56b..581bc4c2 100644 --- a/bertos/drv/adc.h +++ b/bertos/drv/adc.h @@ -37,11 +37,8 @@ * \version $Id$ * \author Francesco Sacchi * - * $WIZARD_MODULE = { - * "name" : "adc", - * "depends" : [], - * "configuration" : "bertos/cfg/cfg_adc.h" - * } + * $WIZ$ module_name = "adc" + * $WIZ$ module_configuration = "bertos/cfg/cfg_adc.h" */ diff --git a/bertos/drv/dataflash.h b/bertos/drv/dataflash.h index fa64ad07..5f8263f8 100644 --- a/bertos/drv/dataflash.h +++ b/bertos/drv/dataflash.h @@ -36,10 +36,9 @@ * * \author Daniele Basile * - * $WIZARD_MODULE = { - * "name" : "dataflash", - * "depends" : ["kfile"], - * "configuration" : "bertos/cfg/cfg_dataflash.h" + * $WIZ$ module_name = "dataflash" + * $WIZ$ module_depends = "kfile" + * $WIZ$ module_configuration = "bertos/cfg/cfg_dataflash.h" * } */ diff --git a/bertos/drv/dc_motor.h b/bertos/drv/dc_motor.h index d9651d68..ebd91e28 100644 --- a/bertos/drv/dc_motor.h +++ b/bertos/drv/dc_motor.h @@ -36,11 +36,9 @@ * * \author Daniele Basile * - * $WIZARD_MODULE = { - * "name" : "dc_motor", - * "depends" : ["pwm", "pid_control", "adc", "timer"], - * "configuration" : "bertos/cfg/cfg_dc_motor.h" - * } + * $WIZ$ module_name = "dc_motor" + * $WIZ$ module_depends = "pwm", "pid_control", "adc", "timer" + * $WIZ$ module_configuration = "bertos/cfg/cfg_dc_motor.h" */ #ifndef DRV_DC_MOTOR_H diff --git a/bertos/drv/eeprom.h b/bertos/drv/eeprom.h index 6c6cd911..91c8dfe1 100644 --- a/bertos/drv/eeprom.h +++ b/bertos/drv/eeprom.h @@ -37,11 +37,8 @@ * \author Stefano Fedrigo * \author Bernie Innocenti * - * $WIZARD_MODULE = { - * "name" : "eeprom", - * "depends" : ["kfile"], - * "configuration" : "" - * } + * $WIZ$ module_name = "eeprom" + * $WIZ$ module_depends = "kfile" */ #ifndef DRV_EEPROM_H diff --git a/bertos/drv/flash25.h b/bertos/drv/flash25.h index e3fd3e9d..53ca9197 100644 --- a/bertos/drv/flash25.h +++ b/bertos/drv/flash25.h @@ -36,11 +36,9 @@ * \version $Id$ * \author Daniele Basile * - * $wizard_module = { - * "name" : "flash25", - * "depends" : ["kfile"], - * "configuration" : "bertos/cfg/cfg_flash25.h" - * } + * $WIZ$ module_name = "flash25" + * $WIZ$ module_depends = "kfile" + * $WIZ$ module_configuration = "bertos/cfg/cfg_flash25.h" */ @@ -90,9 +88,7 @@ INLINE Flash25 * FLASH25_CAST(KFile *fd) * this drive. Every time we call flash25_init() function we check * if memory defined are right (see flash25.c form more detail). * - * $WIZARD_LIST = { - * "flash25_list" : ["FLASH25_AT25F2048"] - * } + * $WIZ$ flash25_list = "FLASH25_AT25F2048" */ #define FLASH25_AT25F2048 1 diff --git a/bertos/drv/ft245rl.h b/bertos/drv/ft245rl.h index 10207b2e..ced7ee19 100644 --- a/bertos/drv/ft245rl.h +++ b/bertos/drv/ft245rl.h @@ -36,11 +36,8 @@ * \version $Id$ * \author Francesco Sacchi * - * $WIZARD_MODULE = { - * "name" : "ft245rl", - * "depends" : ["kfile", "timer"], - * "configuration" : "" - * } + * $WIZ$ module_name = "ft245rl" + * $WIZ$ module_depends = "kfile", "timer" */ diff --git a/bertos/drv/i2c.h b/bertos/drv/i2c.h index 70e33fb1..9327ff8d 100644 --- a/bertos/drv/i2c.h +++ b/bertos/drv/i2c.h @@ -35,12 +35,10 @@ * \version $Id$ * \author Francesco Sacchi * - * $WIZARD_MODULE = { - * "name" : "i2c", - * "depends" : [], + * $WIZ$ module_name = "i2c" * "configuration" : "bertos/cfg/cfg_i2c.h" - * } */ + #ifndef DRV_I2C_H #define DRV_I2C_H @@ -56,9 +54,7 @@ * use that. * With this you can choose, at compile time, which backend to use. * - * $WIZARD_LIST = { - * "i2c_backend" : ["I2C_BACKEND_BUILTIN", "I2C_BACKEND_BITBANG"] - * } + * $WIZ$ i2c_backend = "I2C_BACKEND_BUILTIN", "I2C_BACKEND_BITBANG" */ #define I2C_BACKEND_BUILTIN 0 ///< Uses cpu builtin i2c driver #define I2C_BACKEND_BITBANG 1 ///< Uses emulated bitbang driver diff --git a/bertos/drv/ntc.h b/bertos/drv/ntc.h index 70139e17..3a160ea7 100644 --- a/bertos/drv/ntc.h +++ b/bertos/drv/ntc.h @@ -37,11 +37,8 @@ * \author Giovanni Bajo * \author Francesco Sacchi * - * $WIZARD_MODULE = { - * "name" : "ntc", - * "depends" : ["adc"], - * "configuration" : "" - * } + * $WIZ$ module_name = "ntc" + * $WIZ$ module_depends = "adc" */ #ifndef DRV_NTC_H diff --git a/bertos/drv/pcf8574.h b/bertos/drv/pcf8574.h index 1a1f186d..0eab5c39 100644 --- a/bertos/drv/pcf8574.h +++ b/bertos/drv/pcf8574.h @@ -35,11 +35,8 @@ * \version $Id: ft245rl.c 22301 2008-09-09 16:53:17Z batt $ * \author Francesco Sacchi * - * $WIZARD_MODULE = { - * "name" : "pcf8574", - * "depends" : ["i2c"], - * "configuration" : "" - * } + * $WIZ$ module_name = "pcf8574" + * $WIZ$ module_depends = "i2c" */ #ifndef DRV_PCF8574_H diff --git a/bertos/drv/phase.h b/bertos/drv/phase.h index e15f7d3d..465477a3 100644 --- a/bertos/drv/phase.h +++ b/bertos/drv/phase.h @@ -36,10 +36,9 @@ * \version $Id$ * \author Francesco Sacchi * - * $WIZARD_MODULE = { - * "name" : "phase", - * "depends" : ["timer"], - * "configuration" : "bertos/cfg/cfg_phase.h" + * $WIZ$ module_name = "phase" + * $WIZ$ module_depends = "timer" + * $WIZ$ module_configuration = "bertos/cfg/cfg_phase.h" * } */ diff --git a/bertos/drv/pwm.h b/bertos/drv/pwm.h index c7688f58..f0358214 100644 --- a/bertos/drv/pwm.h +++ b/bertos/drv/pwm.h @@ -37,11 +37,8 @@ * \author Francesco Sacchi * \author Daniele Basile * - * $WIZARD_MODULE = { - * "name" : "pwm", - * "depends" : [], - * "configuration" : "bertos/cfg/cfg_pwm.h" - * } + * $WIZ$ module_name = "pwm" + * $WIZ$ module_configuration = "bertos/cfg/cfg_pwm.h" */ #ifndef DRV_PWM_H diff --git a/bertos/drv/ser.h b/bertos/drv/ser.h index ef622016..cf705aaf 100644 --- a/bertos/drv/ser.h +++ b/bertos/drv/ser.h @@ -36,11 +36,9 @@ * \version $Id$ * \author Bernie Innocenti * - * $WIZARD_MODULE = { - * "name" : "ser", - * "depends" : ["kfile", "timer"], - * "configuration" : "bertos/cfg/cfg_ser.h" - * } + * $WIZ$ module_name = "ser" + * $WIZ$ module_depends = "kfile", "timer" + * $WIZ$ module_configuration = "bertos/cfg/cfg_ser.h" */ #ifndef DRV_SER_H @@ -99,9 +97,7 @@ /** * \name LSB or MSB first data order for SPI driver. * - * $WIZARD_LIST = { - * "ser_order_bit" : ["SER_MSB_FIRST", "SER_LSB_FIRST"] - * } + * $WIZ$ ser_order_bit = "SER_MSB_FIRST", "SER_LSB_FIRST" */ #define SER_MSB_FIRST 0 #define SER_LSB_FIRST 1 diff --git a/bertos/drv/spi_bitbang.h b/bertos/drv/spi_bitbang.h index b2ebb622..c78e9a4f 100644 --- a/bertos/drv/spi_bitbang.h +++ b/bertos/drv/spi_bitbang.h @@ -38,11 +38,8 @@ * \author Francesco Sacchi * \author Daniele Basile * - * $WIZARD_MODULE = { - * "name" : "spi_bitbang", - * "depends" : [], - * "configuration" : "bertos/cfg/cfg_spi_bitbang.h" - * } + * $WIZ$ module_name = "spi_bitbang" + * $WIZ$ module_configuration = "bertos/cfg/cfg_spi_bitbang.h" */ @@ -56,9 +53,7 @@ /** * Define send and receive order bit. * - * $WIZARD_LIST = { - * "ordet_bit_list" : ["SPI_LSB_FIRST", "SPI_MSB_FIRST"] - * } + * $WIZ$ ordet_bit_list = "SPI_LSB_FIRST", "SPI_MSB_FIRST" */ #define SPI_LSB_FIRST 1 #define SPI_MSB_FIRST 2 diff --git a/bertos/drv/stepper.h b/bertos/drv/stepper.h index afa70d8b..0756cf6b 100644 --- a/bertos/drv/stepper.h +++ b/bertos/drv/stepper.h @@ -15,10 +15,9 @@ * \author Simone Zinanni * \author Daniele Basile * - * $WIZARD_MODULE = { - * "name" : "stepper", - * "depends" : ["timer", "ramp"], - * "configuration" : "bertos/cfg/cfg_stepper.h" + * $WIZ$ module_name = "stepper" + * $WIZ$ module_depends = "timer", "ramp" + * $WIZ$ module_configuration = "bertos/cfg/cfg_stepper.h" * } */ diff --git a/bertos/drv/thermo.h b/bertos/drv/thermo.h index 9055274d..8e5f7449 100644 --- a/bertos/drv/thermo.h +++ b/bertos/drv/thermo.h @@ -47,10 +47,9 @@ * \author Giovanni Bajo * \author Francesco Sacchi * - * $WIZARD_MODULE = { - * "name" : "thermo", - * "depends" : ["timer", "ntc"], - * "configuration" : "bertos/cfg/cfg_thermo.h" + * $WIZ$ module_name = "thermo" + * $WIZ$ module_depends = "timer", "ntc" + * $WIZ$ module_configuration = "bertos/cfg/cfg_thermo.h" * } */ diff --git a/bertos/drv/timer.h b/bertos/drv/timer.h index 7d981ccd..3b4ccc9e 100644 --- a/bertos/drv/timer.h +++ b/bertos/drv/timer.h @@ -35,11 +35,8 @@ * \version $Id$ * \author Bernie Innocenti * - * $WIZARD_MODULE = { - * "name" : "timer", - * "depends" : [], - * "configuration" : "bertos/cfg/cfg_timer.h" - * } + * $WIZ$ module_name = "timer" + * $WIZ$ module_configuration = "bertos/cfg/cfg_timer.h" */ #ifndef DRV_TIMER_H diff --git a/bertos/drv/wdt.h b/bertos/drv/wdt.h index e5a90e76..b6db1247 100644 --- a/bertos/drv/wdt.h +++ b/bertos/drv/wdt.h @@ -36,11 +36,8 @@ * * \brief Watchdog module, supplies a simple API to manage wdt on supported target. * - * $WIZARD_MODULE = { - * "name" : "wdt", - * "depends" : [], - * "configuration" : "bertos/cfg/cfg_wdt.h" - * } + * $WIZ$ module_name = "wdt" + * $WIZ$ module_configuration = "bertos/cfg/cfg_wdt.h" */ #ifndef DRV_WDT_H diff --git a/bertos/kern/kfile.h b/bertos/kern/kfile.h index 3b7f5a92..5d3ebc67 100644 --- a/bertos/kern/kfile.h +++ b/bertos/kern/kfile.h @@ -93,11 +93,8 @@ * \author Francesco Sacchi * \author Daniele Basile * - * $WIZARD_MODULE = { - * "name" : "kfile", - * "depends" : [], - * "configuration" : "bertos/cfg/cfg_kfile.h" - * } + * $WIZ$ module_name = "kfile" + * $WIZ$ module_configuration = "bertos/cfg/cfg_kfile.h" */ #ifndef KERN_KFILE_H diff --git a/bertos/kern/proc.h b/bertos/kern/proc.h index 693cd72c..cb35af5d 100644 --- a/bertos/kern/proc.h +++ b/bertos/kern/proc.h @@ -35,11 +35,8 @@ * \version $Id$ * \author Bernie Innocenti * - * $WIZARD_MODULE = { - * "name" : "kernel", - * "depends" : [], - * "configuration" : "bertos/cfg/cfg_kern.h" - * } + * $WIZ$ module_name = "kernel" + * $WIZ$ module_configuration = "bertos/cfg/cfg_kern.h" */ #ifndef KERN_PROC_H diff --git a/bertos/net/pocketbus.h b/bertos/net/pocketbus.h index 7e1317d7..0f26dd90 100644 --- a/bertos/net/pocketbus.h +++ b/bertos/net/pocketbus.h @@ -35,11 +35,9 @@ * * \brief Basical functions to use pocketBus protocol. * - * $WIZARD_MODULE = { - * "name" : "pocketbus", - * "depends" : ["rotating_hash", "kfile"], - * "configuration" : "bertos/cfg/cfg_pocketbus.h" - * } + * $WIZ$ module_name = "pocketbus" + * $WIZ$ module_depends = "rotating_hash", "kfile" + * $WIZ$ module_configuration = "bertos/cfg/cfg_pocketbus.h" */ #ifndef NET_POCKETBUS_H diff --git a/bertos/net/pocketcmd.h b/bertos/net/pocketcmd.h index 7cbc98bf..4e96a623 100644 --- a/bertos/net/pocketcmd.h +++ b/bertos/net/pocketcmd.h @@ -35,11 +35,8 @@ * * \author Francesco Sacchi * - * $WIZARD_MODULE = { - * "name" : "pocketcmd", - * "depends" : ["timer", "pocketbus"], - * "configuration" : "" - * } + * $WIZ$ module_name = "pocketcmd" + * $WIZ$ module_depends = "timer", "pocketbus" */ #ifndef NET_POCKETCMD_H diff --git a/bertos/net/xmodem.h b/bertos/net/xmodem.h index 14f354e8..8832530f 100644 --- a/bertos/net/xmodem.h +++ b/bertos/net/xmodem.h @@ -36,11 +36,9 @@ * \author Bernie Innocenti * \author Francesco Sacchi * - * $WIZARD_MODULE = { - * "name" : "xmodem", - * "depends" : ["kfile"], - * "configuration" : "bertos/cfg/cfg_xmodem.h" - * } + * $WIZ$ module_name = "xmodem" + * $WIZ$ module_depends = "kfile" + * $WIZ$ module_configuration = "bertos/cfg/cfg_xmodem.h" */ diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index ae400b51..33fc5aa4 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -18,6 +18,9 @@ import shutil import const import DefineException +# Try to use the new parsing module for the module information and the define lists +import newParser + def isBertosDir(directory): return os.path.exists(directory + "/VERSION") @@ -165,6 +168,45 @@ def getInfos(definition): return D def loadModuleData(project): + moduleInfoDict = {} + listInfoDict = {} + configurationInfoDict = {} + for filename, path in findDefinitions("*.h", project): + commentList = newParser.getCommentList(open(path + "/" + filename, "r").read()) + if len(commentList) > 0: + moduleInfo = {} + configurationInfo = {} + try: + toBeParsed, moduleDict = newParser.loadModuleDefinition(commentList[0]) + except newParser.ParseError, err: + print "error in file %s. line: %d - statement %s" % (path + "/" + filename, err.line_number, err.line) + print err.args + print err.message + raise Exception + for module, information in moduleDict.items(): + if "configuration" in information.keys() and len(information["configuration"]): + configuration = moduleDict[module]["configuration"] + configurationInfo[configuration] = loadConfigurationInfos(project.info("SOURCES_PATH") + "/" + configuration) + moduleInfoDict.update(moduleDict) + configurationInfoDict.update(configurationInfo) + if toBeParsed: + try: + listDict = newParser.loadDefineLists(commentList[1:]) + listInfoDict.update(listDict) + except newParser.ParseError, err: + print "error in file %s. line: %d - statement %s" % (path + "/" + filename, err.line_number, err.line) + print err.args + print err.message + raise Exception + for filename, path in findDefinitions("*_" + project.info("CPU_INFOS")["TOOLCHAIN"] + ".h", project): + commentList = newParser.getCommentList(open(path + "/" + filename, "r").read()) + listInfoDict.update(newParser.loadDefineLists(commentList)) + project.setInfo("MODULES", moduleInfoDict) + project.setInfo("LISTS", listInfoDict) + project.setInfo("CONFIGURATIONS", configurationInfoDict) + + +def loadModuleData_old(project): """ Loads all the module data, like module definition, list definition, and module configurations int the given BProject, using the SOURCES_PATH information from this as the base for find the diff --git a/wizard/newParser.py b/wizard/newParser.py index 02035c79..86aad567 100644 --- a/wizard/newParser.py +++ b/wizard/newParser.py @@ -45,9 +45,10 @@ def loadModuleDefinition(first_comment): moduleDict[moduleDefinition["module_name"]]["configuration"] = "" if "module_description" in moduleDefinition.keys(): moduleDict[moduleDefinition["module_name"]]["description"] = moduleDefinition["module_description"] + moduleDict[moduleDefinition["module_name"]]["enabled"] = False return toBeParsed, moduleDict -def loadDefineList(commentList): +def loadDefineLists(commentList): defineList = {} for comment in commentList: for num, line in enumerate(comment): @@ -70,9 +71,15 @@ class ParseError(Exception): def main(): try: + defineLists = {} + modules = {} commentList = getCommentList(open("test/to_parse.h", "r").read()) - print loadModuleDefinition(commentList[0]) - print loadDefineList(commentList[1:]) + toBeParsedm, moduleInfo = loadModuleDefinition(commentList[0]) + modules.update(moduleInfo) + if toBeParsed: + defineLists.update(loadDefineList(commentList[1:])) + print modules + print defineLists except ParseError, err: print "Error: line %d - %s" % (err.line_number, err.line) -- 2.25.1