mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #6622 from gebart/pr/cppcheck-fixes
cppcheck fixes 1
This commit is contained in:
commit
4b5952e0ad
@ -854,7 +854,7 @@ static void download_main(int event)
|
|||||||
// bootloader again. Intead, we need to download a tiny ARM
|
// bootloader again. Intead, we need to download a tiny ARM
|
||||||
// program that reconfigures the hardware and then jumps to zero.
|
// program that reconfigures the hardware and then jumps to zero.
|
||||||
//snprintf(buf, sizeof(buf), "G %d A\r\n", 0);
|
//snprintf(buf, sizeof(buf), "G %d A\r\n", 0);
|
||||||
snprintf(buf, sizeof(buf), "W %u %d\r\n", chip->ram_addr, chip->bootprog[0] * 4);
|
snprintf(buf, sizeof(buf), "W %u %u\r\n", chip->ram_addr, chip->bootprog[0] * 4);
|
||||||
xmit_cmd(buf, 4);
|
xmit_cmd(buf, 4);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -120,8 +120,8 @@ int read_intel_hex(const char *filename)
|
|||||||
int
|
int
|
||||||
parse_hex_line(char *line)
|
parse_hex_line(char *line)
|
||||||
{
|
{
|
||||||
int addr, code, num;
|
unsigned int addr, code, num;
|
||||||
int sum, len, cksum, i;
|
unsigned int sum, len, cksum, i;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
|
||||||
num = 0;
|
num = 0;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#ifdef DEBUG_ASSERT_VERBOSE
|
#ifdef DEBUG_ASSERT_VERBOSE
|
||||||
NORETURN void _assert_failure(const char *file, unsigned line)
|
NORETURN void _assert_failure(const char *file, unsigned line)
|
||||||
{
|
{
|
||||||
printf("%s:%d => ", file, line); \
|
printf("%s:%u => ", file, line); \
|
||||||
core_panic(PANIC_ASSERT_FAIL, assert_crash_message); \
|
core_panic(PANIC_ASSERT_FAIL, assert_crash_message); \
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -98,7 +98,7 @@ int gpio_init(gpio_t pin, gpio_mode_t mode)
|
|||||||
const uint32_t port_addr = _port_base[port_num];
|
const uint32_t port_addr = _port_base[port_num];
|
||||||
const uint8_t pin_num = _pin_num(pin);
|
const uint8_t pin_num = _pin_num(pin);
|
||||||
const uint32_t sysctl_port_base = _sysctl_port_base[port_num];
|
const uint32_t sysctl_port_base = _sysctl_port_base[port_num];
|
||||||
const unsigned long pin_bit = 1 << pin_num;
|
const unsigned long pin_bit = 1ul << pin_num;
|
||||||
|
|
||||||
DEBUG("Init GPIO: port %c, %d\n", 'A' + port_num, pin_num);
|
DEBUG("Init GPIO: port %c, %d\n", 'A' + port_num, pin_num);
|
||||||
DEBUG("Sysctl %" PRIx32 "\n", sysctl_port_base);
|
DEBUG("Sysctl %" PRIx32 "\n", sysctl_port_base);
|
||||||
|
@ -380,6 +380,8 @@ static int send_cmd(unsigned int idx, unsigned long arg, unsigned int rt, unsign
|
|||||||
{
|
{
|
||||||
unsigned int s, mc;
|
unsigned int s, mc;
|
||||||
|
|
||||||
|
assert(buff != NULL);
|
||||||
|
|
||||||
if (idx & 0x80) { /* Send a CMD55 prior to the specified command if it is ACMD class */
|
if (idx & 0x80) { /* Send a CMD55 prior to the specified command if it is ACMD class */
|
||||||
if (!send_cmd(CMD55, (unsigned long)CardRCA << 16, 1, buff) /* When CMD55 is faild, */
|
if (!send_cmd(CMD55, (unsigned long)CardRCA << 16, 1, buff) /* When CMD55 is faild, */
|
||||||
|| !(buff[0] & 0x00000020)) {
|
|| !(buff[0] & 0x00000020)) {
|
||||||
|
2
dist/tools/cppcheck/check.sh
vendored
2
dist/tools/cppcheck/check.sh
vendored
@ -17,7 +17,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
BRANCH=${1}
|
BRANCH=${1}
|
||||||
FILEREGEX='\.([sScHh]|cpp)$'
|
FILEREGEX='\.([CcHhSs]|[ch]pp)$'
|
||||||
EXCLUDE='^(cpu/saml21/include/atmel/)|^(cpu/cortexm_common/include/)'
|
EXCLUDE='^(cpu/saml21/include/atmel/)|^(cpu/cortexm_common/include/)'
|
||||||
|
|
||||||
# If no branch but an option is given, unset BRANCH.
|
# If no branch but an option is given, unset BRANCH.
|
||||||
|
@ -55,7 +55,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @param[in] dev RIOT UART device
|
* @param[in] dev RIOT UART device
|
||||||
*/
|
*/
|
||||||
SerialPort(uart_t dev);
|
explicit SerialPort(uart_t dev);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the number of bytes (characters) available for reading from
|
* @brief Get the number of bytes (characters) available for reading from
|
||||||
|
Loading…
Reference in New Issue
Block a user