1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 04:52:59 +01:00
19240: tools/doccheck: add simple exclude to doccheck r=benpicco a=kfessel

while doccheck runs for #19228 and #19220, i saw some spikes in memory consumption, turned out that was `grep -Evf dist/tools/doccheck/exclude_patterns` using about 2GB RAM. This PR changes that.

### Contribution description

add `exclude_simple`  to `doccheck` drived from `exclude patterns`
`sort`ed and `uniq`ued the simple excludes
removes no longer needed patterns from `exclude patterns`

simple excludes are string rules (no patterns just strings) 
how to apply these:
in this PR: 
*remove the path and line number from the rule
* that made some of them doubles of each other
* sorted and uniqued them. 
* this set of excludes is no longer path specific (an exception covers all paths but may of them still contain a file name)

another possible solution would be to have the excludes line number specific.

### Testing procedure

run `dist/tools/doccheck/check.sh`

compare memory consumption of 
master: `grep -Evf dist/tools/doccheck/exclude_patterns`
to 
this PR: `grep -Fvf dist/tools/doccheck/exclude_simple`

### Issues/PRs references



19248: cpu/gd32v: add periph_dac support r=benpicco a=gschorcht

### Contribution description

This PR provides the `periph_dac` support for GD32VF103.

### Testing procedure

`tests/periph_dac` should work on `sipeed-longan-nano` port on PA4 and PA5.

### Issues/PRs references

19255: boards/esp*: complete SD Card MTD config r=benpicco a=gschorcht

### Contribution description

This PR provides the remaining changes necessary to use the generic MTD SD Card configuration as described in PR #19216. 

This includes defining the MTD offset for SD cards, since the default `MTD_0` device always uses the internal flash device, and the completion of the configuration for the ESP32 boards with a SD card interface.

### Testing procedure

`tests/vfs_default` should work now with SD Cards:
```
main(): This is RIOT! (Version: 2023.04-devel-323-gfcc07)
mount points:
	/nvm0
	/sd0

data dir: /sd0
> vfs df 
Mountpoint              Total         Used    Available     Use%
/nvm0                3052 KiB        8 KiB     3044 KiB       0%
/sd0                 7580 MiB 3632148992 B   21089792 B      99%
```

### Issues/PRs references


Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
This commit is contained in:
bors[bot] 2023-02-07 14:55:44 +00:00 committed by GitHub
commit dd2d336962
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 8886 additions and 12731 deletions

View File

@ -129,6 +129,15 @@ extern "C" {
/** Pointer to the default MTD drive structure */
extern mtd_dev_t *mtd0;
/**
* @brief MTD offset for SD Card interfaces
*
* MTD_1 is used for SD Card.
*/
#ifndef CONFIG_SDCARD_GENERIC_MTD_OFFSET
#define CONFIG_SDCARD_GENERIC_MTD_OFFSET 1
#endif
/** @} */
#endif /* MODULE_MTD || DOXYGEN */

View File

@ -110,6 +110,15 @@ extern "C" {
/** Pointer to the default MTD drive structure */
extern mtd_dev_t *mtd0;
/**
* @brief MTD offset for SD Card interfaces
*
* MTD_1 is used for SD Card.
*/
#ifndef CONFIG_SDCARD_GENERIC_MTD_OFFSET
#define CONFIG_SDCARD_GENERIC_MTD_OFFSET 1
#endif
/** @} */
#endif /* MODULE_MTD || DOXYGEN */

View File

@ -110,6 +110,15 @@ extern "C" {
/** Pointer to the default MTD drive structure */
extern mtd_dev_t *mtd0;
/**
* @brief MTD offset for SD Card interfaces
*
* MTD_1 is used for SD Card.
*/
#ifndef CONFIG_SDCARD_GENERIC_MTD_OFFSET
#define CONFIG_SDCARD_GENERIC_MTD_OFFSET 1
#endif
/** @} */
#endif /* MODULE_MTD || DOXYGEN */

View File

@ -110,6 +110,15 @@ extern "C" {
/** Pointer to the default MTD drive structure */
extern mtd_dev_t *mtd0;
/**
* @brief MTD offset for SD Card interfaces
*
* MTD_1 is used for SD Card.
*/
#ifndef CONFIG_SDCARD_GENERIC_MTD_OFFSET
#define CONFIG_SDCARD_GENERIC_MTD_OFFSET 1
#endif
/** @} */
#endif /* MODULE_MTD || DOXYGEN */

View File

@ -95,6 +95,15 @@ extern "C" {
/** Pointer to the default MTD device structure */
extern mtd_dev_t *mtd0;
/**
* @brief MTD offset for SD Card interfaces
*
* MTD_1 is used for SD Card.
*/
#ifndef CONFIG_SDCARD_GENERIC_MTD_OFFSET
#define CONFIG_SDCARD_GENERIC_MTD_OFFSET 1
#endif
/** @} */
#endif /* defined(MODULE_MTD) || defined(DOXYGEN) */

View File

@ -18,5 +18,9 @@ config BOARD_ESP32_WEMOS_LOLIN_D32_PRO
select HAS_PERIPH_I2C
select HAS_PERIPH_PWM
select HAS_PERIPH_SPI
select HAS_SDCARD_SPI
select HAVE_MTD_SDCARD_DEFAULT
select MODULE_FATFS_VFS if MODULE_VFS_DEFAULT
source "$(RIOTBOARD)/common/esp32/Kconfig"

View File

@ -1 +1,11 @@
ifneq (,$(filter mtd,$(USEMODULE)))
USEMODULE += mtd_sdcard_default
endif
# default to using fatfs on SD card
ifneq (,$(filter vfs_default,$(USEMODULE)))
USEMODULE += fatfs_vfs
USEMODULE += mtd
endif
include $(RIOTBOARD)/common/esp32/Makefile.dep

View File

@ -9,5 +9,6 @@ FEATURES_PROVIDED += periph_dac
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += sdcard_spi
FEATURES_PROVIDED += arduino

View File

@ -22,5 +22,7 @@ config BOARD_ESP32_WROVER_KIT
select HAS_SDCARD_SPI
select HAVE_ILI9341
select HAVE_MTD_SDCARD_DEFAULT
select MODULE_FATFS_VFS if MODULE_VFS_DEFAULT
source "$(RIOTBOARD)/common/esp32/Kconfig"

View File

@ -5,4 +5,14 @@ endif
# Sets up configuration for openocd
USEMODULE += esp_jtag
ifneq (,$(filter mtd,$(USEMODULE)))
USEMODULE += mtd_sdcard_default
endif
# default to using fatfs on SD card
ifneq (,$(filter vfs_default,$(USEMODULE)))
USEMODULE += fatfs_vfs
USEMODULE += mtd
endif
include $(RIOTBOARD)/common/esp32/Makefile.dep

View File

@ -38,7 +38,7 @@ on-board components:
| RTC | 1 x 32-bit counter, 20-bit prescaler | yes |
| WDT | 2 x 12-bit counter, 3-bit prescaler | yes |
| ADC | 2 x 12-bit units, 16 channels @ 1 Msps | yes |
| DAC | 2 x 12-bit channel | no |
| DAC | 2 x 12-bit channel | yes |
| UART | 2 | yes |
| USART | 3 | yes |
| SPI | 3 | yes |

View File

@ -15,6 +15,7 @@ config BOARD_SIPEED_LONGAN_NANO
select BOARD_HAS_HXTAL
select BOARD_HAS_LXTAL
select HAS_PERIPH_ADC
select HAS_PERIPH_DAC
select HAS_PERIPH_I2C
select HAS_PERIPH_PWM
select HAS_PERIPH_SPI

View File

@ -2,6 +2,7 @@ CPU_MODEL = gd32vf103cbt6
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_dac
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_spi

View File

@ -32,7 +32,7 @@ on-board components:
| RTC | 1 x 32-bit counter, 20-bit prescaler | yes |
| WDT | 2 x 12-bit counter, 3-bit prescaler | yes |
| ADC | 2 x 12-bit units, 16 channels @ 1 Msps | yes |
| DAC | 2 x 12-bit channel | no |
| DAC | 2 x 12-bit channel | yes |
| UART | - | yes |
| USART | 3 | yes |
| SPI | 3 | yes |

View File

@ -77,6 +77,20 @@ static const adc_conf_t adc_config[] = {
#define ADC_NUMOF ARRAY_SIZE(adc_config)
/** @} */
/**
* @name DAC configuration
* @{
*/
static const dac_conf_t dac_config[] = {
#if !CONFIG_SIPEED_LONGAN_NANO_WITH_TFT
{ .pin = GPIO_PIN(PORT_A, 4), .chan = 0 },
{ .pin = GPIO_PIN(PORT_A, 5), .chan = 1 },
};
#endif /* !CONFIG_SIPEED_LONGAN_NANO_WITH_TFT */
#define DAC_NUMOF ARRAY_SIZE(dac_config)
/** @} */
/**
* @name PWM configuration
* @{

View File

@ -197,6 +197,19 @@ typedef struct {
uint8_t chan; /**< CPU ADC channel connected to the pin */
} adc_conf_t;
/**
* @brief GD32V DAC has 2 channels
*/
#define DAC_CHANNEL_NUMOF (2)
/**
* @brief DAC line configuration data
*/
typedef struct {
gpio_t pin; /**< pin connected to the line */
uint8_t chan; /**< DAC device used for this line */
} dac_conf_t;
/**
* @brief GD32V timers have 4 capture-compare channels
*/

78
cpu/gd32v/periph/dac.c Normal file
View File

@ -0,0 +1,78 @@
/*
* Copyright (C) 2023 Gunar Schorcht
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup cpu_gd32v
* @ingroup drivers_periph_dac
* @{
*
* @file
* @brief Low-level DAC driver implementation for GD32VF103
*
* @author Gunar Schorcht <gunar@schorcht.net>
*
* @}
*/
#include "assert.h"
#include "cpu.h"
#include "periph/dac.h"
#define DAC_CTL_DENX_MASK (DAC_CTL_DEN0_Msk | DAC_CTL_DEN1_Msk)
int8_t dac_init(dac_t line)
{
assert(line < DAC_NUMOF);
gpio_init_analog(dac_config[line].pin);
dac_poweron(line);
dac_set(line, 0);
return DAC_OK;
}
void dac_set(dac_t line, uint16_t value)
{
assert(line < DAC_NUMOF);
assert(dac_config[line].chan < DAC_CHANNEL_NUMOF);
/* set the upper 12 bit of the left aligned DAC data holding register */
if (dac_config[line].chan) {
DAC->DAC1_L12DH = value & 0xfff0;
}
else {
DAC->DAC0_L12DH = value & 0xfff0;
}
}
void dac_poweron(dac_t line)
{
assert(line < DAC_NUMOF);
assert(dac_config[line].chan < DAC_CHANNEL_NUMOF);
/* enable the DAC clock */
periph_clk_en(APB1, RCU_APB1EN_DACEN_Msk);
/* enable the DAC channel */
DAC->CTL |= (dac_config[line].chan) ? DAC_CTL_DEN1_Msk : DAC_CTL_DEN0_Msk;
}
void dac_poweroff(dac_t line)
{
assert(line < DAC_NUMOF);
assert(dac_config[line].chan < DAC_CHANNEL_NUMOF);
/* disable the DAC channel */
DAC->CTL &= ~((dac_config[line].chan) ? DAC_CTL_DEN1_Msk : DAC_CTL_DEN0_Msk);
if ((DAC->CTL & DAC_CTL_DENX_MASK) == 0) {
/* disable the DAC clock only if both channels are disabled */
periph_clk_dis(APB1, RCU_APB1EN_DACEN_Msk);
}
}

View File

@ -12,6 +12,7 @@
# shellcheck disable=SC2164
SCRIPTDIR="$(cd "$(dirname "$0")"; pwd)"
RIOTBASE="$(cd "${SCRIPTDIR}"/../../..; pwd)"
EXCLUDE_SIMPLE_FILE="${SCRIPTDIR}/exclude_simple"
EXCLUDE_PATTERN_FILE="${SCRIPTDIR}/exclude_patterns"
GENERIC_EXCLUDE_PATTERN_FILE="${SCRIPTDIR}/generic_exclude_patterns"
@ -32,8 +33,8 @@ else
CWARN=
CRESET=
fi
DOXY_OUTPUT=$(make -C "${RIOTBASE}" doc 2>&1 | grep -Evf "${EXCLUDE_PATTERN_FILE}" -f"${GENERIC_EXCLUDE_PATTERN_FILE}")
DOXY_OUTPUT=$(make -C "${RIOTBASE}" doc 2>&1| grep -Fvf "${EXCLUDE_SIMPLE_FILE}" )
DOXY_OUTPUT=$(echo "${DOXY_OUTPUT}" | grep -Evf "${EXCLUDE_PATTERN_FILE}" | grep -Evf "${GENERIC_EXCLUDE_PATTERN_FILE}")
DOXY_ERRCODE=$?
RESULT=0

File diff suppressed because it is too large Load Diff

8700
dist/tools/doccheck/exclude_simple vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,8 @@ warning: Member BTN[0-9]_PIN \(macro definition\) of
warning: Member BTN[0-9]_PORT \(macro definition\) of
warning: Member BTN[0-9]_PRESSED \(macro definition\) of
warning: Member BTN[0-9]_RELEASED \(macro definition\) of
warning: Member dac_config\[\] \(variable\) of
warning: Member DAC_NUMOF \(macro definition\) of
warning: Member EPD_BW_SPI_CMD_[A-Z0-9_]* \(macro definition\) of
warning: Member EPD_BW_SPI_DISPLAY_UPDATE_OPTION_[A-Z0-9_]* \(macro definition\) of
warning: Member EPD_BW_SPI_WAIT_[A-Z0-9_]* \(macro definition\) of