Skip to content

Commit fe9bea1

Browse files
flitmbrossard
authored andcommitted
Make main.* file names unique.
- Renamed main.{c,h} to main_{bootloader,interface}.{c,h}. - daplink.h defines a DAPLINK_MAIN_HEADER macro with the name of the main app header for the current project. - Updated files that include "main.h" to use the header name macro.
1 parent 4299c5b commit fe9bea1

10 files changed

Lines changed: 38 additions & 27 deletions

File tree

source/daplink/bootloader/main.c renamed to source/daplink/bootloader/main_bootloader.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* @file main.c
2+
* @file main_bootloader.c
33
* @brief DAPLink Bootloader application entry point
44
*
55
* DAPLink Interface Firmware
6-
* Copyright (c) 2009-2019, ARM Limited, All Rights Reserved
6+
* Copyright (c) 2009-2020 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
@@ -19,7 +19,7 @@
1919
* limitations under the License.
2020
*/
2121

22-
#include "main.h"
22+
#include "main_bootloader.h"
2323
#include "gpio.h"
2424
#include "validation.h"
2525
#include "vfs_manager.h"

source/daplink/bootloader/main.h renamed to source/daplink/bootloader/main_bootloader.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* @file main.h
2+
* @file main_bootloader.h
33
* @brief
44
*
55
* DAPLink Interface Firmware
6-
* Copyright (c) 2009-2019, ARM Limited, All Rights Reserved
6+
* Copyright (c) 2009-2020 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
@@ -19,8 +19,8 @@
1919
* limitations under the License.
2020
*/
2121

22-
#ifndef MAIN_H
23-
#define MAIN_H
22+
#ifndef MAIN_BOOTLOADER_H
23+
#define MAIN_BOOTLOADER_H
2424

2525
#include <stdint.h>
2626

‎source/daplink/cmsis-dap/DAP_vendor.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (c) 2013-2016 ARM Limited. All rights reserved.
3-
* Copyright 2019, Cypress Semiconductor Corporation
2+
* Copyright (c) 2013-2020 Arm Limited. All rights reserved.
3+
* Copyright 2019, Cypress Semiconductor Corporation
44
* or a subsidiary of Cypress Semiconductor Corporation.
55
*
66
* SPDX-License-Identifier: Apache-2.0
@@ -31,7 +31,8 @@
3131
#include "DAP_config.h"
3232
#include "DAP.h"
3333
#include "info.h"
34-
#include "main.h"
34+
#include "daplink.h"
35+
#include DAPLINK_MAIN_HEADER
3536
#include "uart.h"
3637
#include "settings.h"
3738
#include "target_family.h"
@@ -169,7 +170,7 @@ uint32_t DAP_ProcessVendorCommand(const uint8_t *request, uint8_t *response) {
169170
// 0x00 - Chip Erase
170171
// nonzero - Page Erase
171172
// RESPONSE(IN Packet)
172-
// BYTE 0
173+
// BYTE 0
173174
// 0x00 - OK
174175
*response = DAP_OK;
175176
if (0x00U == *request) {

‎source/daplink/daplink.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ COMPILER_ASSERT(DAPLINK_RAM_SHARED_START + DAPLINK_RAM_SHARED_SIZE == DAPLINK_RA
7373

7474
#define DAPLINK_INFO_OFFSET 0x20
7575

76+
// Macro with the name of the main application header file.
77+
#if defined(DAPLINK_BL)
78+
#define DAPLINK_MAIN_HEADER "main_bootloader.h"
79+
#elif defined(DAPLINK_IF)
80+
#define DAPLINK_MAIN_HEADER "main_interface.h"
81+
#else
82+
#error "Neither DAPLINK_BL nor DAPLINK_IF are defined!"
83+
#endif
84+
7685
typedef struct {
7786
uint32_t build_key;
7887
uint32_t hic_id;

‎source/daplink/drag-n-drop/vfs_manager.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @brief Implementation of vfs_manager.h
44
*
55
* DAPLink Interface Firmware
6-
* Copyright (c) 2009-2019, ARM Limited, All Rights Reserved
6+
* Copyright (c) 2009-2020 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
@@ -21,15 +21,15 @@
2121

2222
#include <ctype.h>
2323

24-
#include "main.h"
24+
#include "daplink.h"
25+
#include DAPLINK_MAIN_HEADER
2526
#include "cmsis_os2.h"
2627
#include "rl_usb.h"
2728
#include "virtual_fs.h"
2829
#include "vfs_manager.h"
2930
#include "daplink_debug.h"
3031
#include "info.h"
3132
#include "settings.h"
32-
#include "daplink.h"
3333
#include "util.h"
3434
#include "version_git.h"
3535
#include "IO_Config.h"

‎source/daplink/info.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @brief Implementation of info.h
44
*
55
* DAPLink Interface Firmware
6-
* Copyright (c) 2009-2019, ARM Limited, All Rights Reserved
6+
* Copyright (c) 2009-2020 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
@@ -20,7 +20,6 @@
2020
*/
2121

2222
#include <string.h>
23-
#include "main.h"
2423
#include "info.h"
2524
#include "target_config.h"
2625
#include "read_uid.h"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* @file main.c
2+
* @file main_interface.c
33
* @brief Entry point for interface program logic
44
*
55
* DAPLink Interface Firmware
6-
* Copyright (c) 2009-2019, ARM Limited, All Rights Reserved
6+
* Copyright (c) 2009-2020 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
@@ -24,7 +24,7 @@
2424

2525
#include "cmsis_os2.h"
2626
#include "rl_usb.h"
27-
#include "main.h"
27+
#include "main_interface.h"
2828
#include "gpio.h"
2929
#include "uart.h"
3030
#include "tasks.h"
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* @file main.h
2+
* @file main_interface.h
33
* @brief
44
*
55
* DAPLink Interface Firmware
6-
* Copyright (c) 2009-2019, ARM Limited, All Rights Reserved
6+
* Copyright (c) 2009-2020 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
@@ -19,8 +19,8 @@
1919
* limitations under the License.
2020
*/
2121

22-
#ifndef MAIN_H
23-
#define MAIN_H
22+
#ifndef MAIN_INTERFACE_H
23+
#define MAIN_INTERFACE_H
2424

2525
#include <stdint.h>
2626
#include <stdbool.h>

‎source/daplink/usb2uart/usbd_user_cdc_acm.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @brief implementation of USB CDC ACM middleware
44
*
55
* DAPLink Interface Firmware
6-
* Copyright (c) 2009-2019, ARM Limited, All Rights Reserved
6+
* Copyright (c) 2009-2020 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
@@ -21,7 +21,8 @@
2121

2222
#include "cmsis_os2.h"
2323
#include "rl_usb.h"
24-
#include "main.h"
24+
#include "daplink.h"
25+
#include DAPLINK_MAIN_HEADER
2526
#include "uart.h"
2627
#ifdef DRAG_N_DROP_SUPPORT
2728
#include "flash_intf.h"

‎source/usb/hid/usbd_user_hid.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @brief HID driver for CMSIS-DAP packet processing
44
*
55
* DAPLink Interface Firmware
6-
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
6+
* Copyright (c) 2009-2020 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
@@ -28,7 +28,8 @@
2828
#include "DAP.h"
2929
#include "util.h"
3030
#include "DAP_queue.h"
31-
#include "main.h"
31+
#include "daplink.h"
32+
#include DAPLINK_MAIN_HEADER
3233

3334

3435
#if (USBD_HID_OUTREPORT_MAX_SZ > DAP_PACKET_SIZE)

0 commit comments

Comments
 (0)