Skip to content

Commit e51b506

Browse files
authored
Merge pull request #688 from flit/cleanup/misc2
More misc cleanup
2 parents 27f3b26 + 3bfd302 commit e51b506

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+248
-274
lines changed

source/daplink/bootloader/main.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @brief
44
*
55
* DAPLink Interface Firmware
6-
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
6+
* Copyright (c) 2009-2019, ARM Limited, All Rights Reserved
77
* SPDX-License-Identifier: Apache-2.0
88
*
99
* Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -22,11 +22,7 @@
2222
#ifndef MAIN_H
2323
#define MAIN_H
2424

25-
#include "stdint.h"
26-
27-
#ifdef __cplusplus
28-
extern "C" {
29-
#endif
25+
#include <stdint.h>
3026

3127
/**
3228
* @enum main_usb_busy_t
@@ -59,6 +55,10 @@ typedef enum {
5955
MAIN_LED_FLASH_PERMANENT
6056
} main_led_state_t;
6157

58+
#ifdef __cplusplus
59+
extern "C" {
60+
#endif
61+
6262
/**
6363
* Allows other parts of the program to request the device to eject physical media
6464
* @param none

source/daplink/circ_buf.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "circ_buf.h"
2323

2424
#include "cortex_m.h"
25-
#include "macro.h"
2625
#include "util.h"
2726

2827
void circ_buf_init(circ_buf_t *circ_buf, uint8_t *buffer, uint32_t size)
@@ -74,7 +73,7 @@ uint8_t circ_buf_pop(circ_buf_t *circ_buf)
7473
}
7574

7675
cortex_int_restore(state);
77-
76+
7877
return data;
7978
}
8079

@@ -94,7 +93,7 @@ uint32_t circ_buf_count_used(circ_buf_t *circ_buf)
9493
cortex_int_restore(state);
9594
return cnt;
9695
}
97-
96+
9897
uint32_t circ_buf_count_free(circ_buf_t *circ_buf)
9998
{
10099
uint32_t cnt;

source/daplink/circ_buf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#ifndef CIRC_BUF_H
2323
#define CIRC_BUF_H
2424

25-
#include "stdbool.h"
26-
#include "stdint.h"
25+
#include <stdbool.h>
26+
#include <stdint.h>
2727

2828
#ifdef __cplusplus
2929
extern "C" {

source/daplink/cortex_m.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#ifndef CORTEX_M_H
2323
#define CORTEX_M_H
2424

25-
#include "stdint.h"
26-
#include "stdbool.h"
25+
#include <stdint.h>
26+
#include <stdbool.h>
2727

2828
#include "IO_Config.h"
2929

source/daplink/crc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#ifndef _crc_h
2222
#define _crc_h
2323

24-
#include "stdint.h"
24+
#include <stdint.h>
2525

2626
#ifdef __cplusplus
2727
extern "C" {

source/daplink/daplink.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#ifndef DAPLINK_H
2323
#define DAPLINK_H
2424

25-
#include "stdbool.h"
26-
#include "stdint.h"
25+
#include <stdbool.h>
26+
#include <stdint.h>
2727

2828
#include "daplink_addr.h"
2929
#include "compiler.h"

source/daplink/daplink_debug.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
#ifndef DAPLINK_DEBUG_H
2323
#define DAPLINK_DEBUG_H
2424

25-
#include "stdarg.h"
26-
#include "stdio.h"
27-
#include "string.h"
28-
#include "stdint.h"
25+
#include <stdarg.h>
26+
#include <stdio.h>
27+
#include <string.h>
28+
#include <stdint.h>
2929
#include "cmsis_os2.h"
3030
#include "rl_usb.h"
31-
#include "macro.h"
31+
#include "util.h"
3232

3333
#ifdef __cplusplus
3434
extern "C" {

source/daplink/drag-n-drop/file_stream.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919
* limitations under the License.
2020
*/
2121

22-
#include "string.h"
22+
#include <string.h>
2323

2424
#include "file_stream.h"
2525
#include "util.h"
26-
#include "macro.h"
2726
#include "intelhex.h"
2827
#include "flash_decoder.h"
2928
#include "error.h"
@@ -80,7 +79,7 @@ stream_t stream[] = {
8079
{detect_bin, open_bin, write_bin, close_bin}, // STREAM_TYPE_BIN
8180
{detect_hex, open_hex, write_hex, close_hex}, // STREAM_TYPE_HEX
8281
};
83-
COMPILER_ASSERT(ELEMENTS_IN_ARRAY(stream) == STREAM_TYPE_COUNT);
82+
COMPILER_ASSERT(ARRAY_SIZE(stream) == STREAM_TYPE_COUNT);
8483
// STREAM_TYPE_NONE must not be included in count
8584
COMPILER_ASSERT(STREAM_TYPE_NONE > STREAM_TYPE_COUNT);
8685

source/daplink/drag-n-drop/file_stream.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#ifndef FILE_STREAM_H
2323
#define FILE_STREAM_H
2424

25-
#include "stdint.h"
25+
#include <stdint.h>
2626

2727
#include "virtual_fs.h"
2828
#include "error.h"

source/daplink/drag-n-drop/flash_decoder.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919
* limitations under the License.
2020
*/
2121

22-
#include "string.h"
22+
#include <string.h>
2323

2424
#include "flash_decoder.h"
2525
#include "util.h"
26-
#include "macro.h"
2726
#include "daplink.h"
2827
#include "flash_manager.h"
2928
#include "target_config.h" // for target_device
@@ -353,7 +352,7 @@ static bool flash_decoder_is_at_end(uint32_t addr, const uint8_t *data, uint32_t
353352
case FLASH_DECODER_TYPE_INTERFACE:
354353
end_addr = DAPLINK_ROM_IF_START + DAPLINK_ROM_IF_SIZE;
355354
break;
356-
355+
357356
case FLASH_DECODER_TYPE_TARGET:
358357
//only if we are sure it is a bin for the target; without check unordered hex files will cause to terminate flashing
359358
if (flash_type_target_bin && g_board_info.target_cfg) {
@@ -367,7 +366,7 @@ static bool flash_decoder_is_at_end(uint32_t addr, const uint8_t *data, uint32_t
367366
if(end_addr == 0){ //invalid end_addr
368367
return false;
369368
}
370-
369+
371370
}
372371
else {
373372
return false;

0 commit comments

Comments
 (0)