Skip to content

Commit

Permalink
Naming convention for header includes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nightwalker-87 committed May 3, 2023
1 parent 5621d54 commit b1c4de6
Show file tree
Hide file tree
Showing 29 changed files with 87 additions and 87 deletions.
6 changes: 3 additions & 3 deletions inc/backend.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef BACKEND_H_
#define BACKEND_H_
#ifndef BACKEND_H
#define BACKEND_H

typedef struct _stlink_backend {
void (*close) (stlink_t * sl);
Expand Down Expand Up @@ -34,4 +34,4 @@
int (*trace_read) (stlink_t * sl, uint8_t* buf, size_t size);
} stlink_backend_t;

#endif // BACKEND_H_
#endif // BACKEND_H
6 changes: 3 additions & 3 deletions inc/stlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* regardless of how the backend does the work....
*/

#ifndef STLINK_H_
#define STLINK_H_
#ifndef STLINK_H
#define STLINK_H

#include <stdint.h>
#include <stddef.h>
Expand Down Expand Up @@ -311,4 +311,4 @@ int stlink_target_connect(stlink_t *sl, enum connect_type connect);
}
#endif

#endif // STLINK_H_
#endif // STLINK_H
6 changes: 3 additions & 3 deletions inc/stm32.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* STM32-specific defines & identification parametres
*/

#ifndef STM32_H_
#define STM32_H_
#ifndef STM32_H
#define STM32_H

/* STM32 Cortex-M core ids (CPUTAPID) */
enum stm32_core_id {
Expand Down Expand Up @@ -217,4 +217,4 @@ enum stm32_chipids {
#define STM32L5_PWR_CR1 0x40007000 // RM0438, p. 93,324
#define STM32L5_PWR_CR1_VOS 9

#endif // STM32_H_
#endif // STM32_H
6 changes: 3 additions & 3 deletions inc/stm32flash.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef STM32FLASH_H_
#define STM32FLASH_H_
#ifndef STM32FLASH_H
#define STM32FLASH_H

/* STM32Fx FPEC flash controller interface, PM0063 manual */
// STM32F05x is identical, based on RM0091 (DM00031936, Doc ID 018940 Rev.2, Aug 2012)
Expand Down Expand Up @@ -408,4 +408,4 @@
#define FLASH_WB_SR_PGAERR (5) /* Programming error */
#define FLASH_WB_SR_BSY (16) /* Busy */

#endif // STM32FLASH_H_
#endif // STM32FLASH_H
6 changes: 3 additions & 3 deletions inc/version.h.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef VERSION_H_
#define VERSION_H_
#ifndef VERSION_H
#define VERSION_H

#define STLINK_VERSION "@PROJECT_VERSION@"
#define STLINK_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define STLINK_VERSION_MINOR @PROJECT_VERSION_MINOR@
#define STLINK_VERSION_PATCH @PROJECT_VERSION_PATCH@

#endif // VERSION_H_
#endif // VERSION_H
6 changes: 3 additions & 3 deletions src/st-flash/flash.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef FLASH_H_
#define FLASH_H_
#ifndef FLASH_H
#define FLASH_H

#include <stdint.h>

Expand Down Expand Up @@ -33,4 +33,4 @@ struct flash_opts {

int flash_get_opts(struct flash_opts* o, int ac, char** av);

#endif // FLASH_H_
#endif // FLASH_H
6 changes: 3 additions & 3 deletions src/st-util/gdb-remote.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef GDB_REMOTE_H_
#define GDB_REMOTE_H_
#ifndef GDB_REMOTE_H
#define GDB_REMOTE_H

int gdb_send_packet(int fd, char* data);
int gdb_recv_packet(int fd, char** buffer);
int gdb_check_for_interrupt(int fd);

#endif // GDB_REMOTE_H_
#endif // GDB_REMOTE_H
6 changes: 3 additions & 3 deletions src/st-util/gdb-server.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef GDB_SERVER_H_
#define GDB_SERVER_H_
#ifndef GDB_SERVER_H
#define GDB_SERVER_H

#define STRINGIFY_inner(name) #name
#define STRINGIFY(name) STRINGIFY_inner(name)
Expand All @@ -8,4 +8,4 @@
#define DEBUG_LOGGING_LEVEL 100
#define DEFAULT_GDB_LISTEN_PORT 4242

#endif // GDB_SERVER_H_
#endif // GDB_SERVER_H
6 changes: 3 additions & 3 deletions src/st-util/semihosting.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef SEMIHOSTING_H_
#define SEMIHOSTING_H_
#ifndef SEMIHOSTING_H
#define SEMIHOSTING_H

#include <stlink.h>

Expand Down Expand Up @@ -31,4 +31,4 @@

int do_semihosting(stlink_t *sl, uint32_t r0, uint32_t r1, uint32_t *ret);

#endif // SEMIHOSTING_H_
#endif // SEMIHOSTING_H
6 changes: 3 additions & 3 deletions src/stlink-gui/gui.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef GUI_H_
#define GUI_H_
#ifndef GUI_H
#define GUI_H

#include <glib-object.h>

Expand Down Expand Up @@ -89,4 +89,4 @@ struct _STlinkGUIClass {
GType stlink_gui_get_type(void);
int export_to_file(const char*filename, const struct mem_t flash_mem);

#endif // GUI_H_
#endif // GUI_H
6 changes: 3 additions & 3 deletions src/stlink-lib/calculate.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
* Calculation of sector numbers and pages
*/

#ifndef CALCULATE_H_
#define CALCULATE_H_
#ifndef CALCULATE_H
#define CALCULATE_H

uint32_t calculate_F4_sectornum(uint32_t);
uint32_t calculate_F7_sectornum(uint32_t);
uint32_t calculate_H7_sectornum(stlink_t *, uint32_t, unsigned);
uint32_t calculate_L4_page(stlink_t *, uint32_t);

#endif // CALCULATE_H_
#endif // CALCULATE_H
6 changes: 3 additions & 3 deletions src/stlink-lib/chipid.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef CHIPID_H_
#define CHIPID_H_
#ifndef CHIPID_H
#define CHIPID_H

#include <stm32.h>
#include <stlink.h>
Expand All @@ -24,4 +24,4 @@ struct stlink_chipid_params {
struct stlink_chipid_params *stlink_chipid_get_params(uint32_t chipid);
void init_chipids(char *dir_to_scan);

#endif // CHIPID_H_
#endif // CHIPID_H
6 changes: 3 additions & 3 deletions src/stlink-lib/commands.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef COMMANDS_H_
#define COMMANDS_H_
#ifndef COMMANDS_H
#define COMMANDS_H

enum stlink_commands {
STLINK_GET_VERSION = 0xF1,
Expand Down Expand Up @@ -54,4 +54,4 @@ enum stlink_dfu_commands {
STLINK_DFU_EXIT = 0x07
};

#endif // COMMANDS_H_
#endif // COMMANDS_H
6 changes: 3 additions & 3 deletions src/stlink-lib/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
* General helper functions
*/

#ifndef COMMON_H_
#define COMMON_H_
#ifndef COMMON_H
#define COMMON_H

int check_file(stlink_t *, mapped_file_t *, stm32_addr_t);
void md5_calculate(mapped_file_t *);
void stlink_checksum(mapped_file_t *);
void stlink_fwrite_finalize(stlink_t *, stm32_addr_t);

#endif // COMMON_H_
#endif // COMMON_H
6 changes: 3 additions & 3 deletions src/stlink-lib/common_flash.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* Flash operations
*/

#ifndef COMMON_FLASH_H_
#define COMMON_FLASH_H_
#ifndef COMMON_FLASH_H
#define COMMON_FLASH_H

void lock_flash(stlink_t *);
void clear_flash_error(stlink_t *);
Expand All @@ -25,4 +25,4 @@ void clear_flash_cr_pg(stlink_t *, unsigned);
uint32_t read_flash_cr(stlink_t *, unsigned);
uint32_t get_stm32l0_flash_base(stlink_t *);

#endif // COMMON_FLASH_H_
#endif // COMMON_FLASH_H
6 changes: 3 additions & 3 deletions src/stlink-lib/flash_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* Flash loader
*/

#ifndef FLASH_LOADER_H_
#define FLASH_LOADER_H_
#ifndef FLASH_LOADER_H
#define FLASH_LOADER_H

#include <stdio.h>
#include <stdint.h>
Expand All @@ -21,4 +21,4 @@ int stlink_flashloader_start(stlink_t *sl, flash_loader_t *fl);
int stlink_flashloader_write(stlink_t *sl, flash_loader_t *fl, stm32_addr_t addr, uint8_t* base, uint32_t len);
int stlink_flashloader_stop(stlink_t *sl, flash_loader_t *fl);

#endif // FLASH_LOADER_H_
#endif // FLASH_LOADER_H
6 changes: 3 additions & 3 deletions src/stlink-lib/helper.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef HELPER_H_
#define HELPER_H_
#ifndef HELPER_H
#define HELPER_H

unsigned time_ms();

int arg_parse_freq(const char *str);

#endif // HELPER_H_
#endif // HELPER_H
6 changes: 3 additions & 3 deletions src/stlink-lib/libusb_settings.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef LIBUSB_SETTINGS_H_
#define LIBUSB_SETTINGS_H_
#ifndef LIBUSB_SETTINGS_H
#define LIBUSB_SETTINGS_H

#include <libusb.h>

Expand Down Expand Up @@ -44,4 +44,4 @@
#error unsupported libusb version
#endif

#endif // LIBUSB_SETTINGS_H_
#endif // LIBUSB_SETTINGS_H
6 changes: 3 additions & 3 deletions src/stlink-lib/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Ugly, low performance, configurable level, logging "framework"
*/

#ifndef LOGGING_H_
#define LOGGING_H_
#ifndef LOGGING_H
#define LOGGING_H

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -45,4 +45,4 @@ int ugly_libusb_log_level(enum ugly_loglevel v);
}
#endif

#endif // LOGGING_H_
#endif // LOGGING_H
6 changes: 3 additions & 3 deletions src/stlink-lib/map_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* File mapping
*/

#ifndef MAP_FILE_H_
#define MAP_FILE_H_
#ifndef MAP_FILE_H
#define MAP_FILE_H

#ifndef O_BINARY
#define O_BINARY 0
Expand All @@ -29,4 +29,4 @@ typedef struct mapped_file {
int map_file(mapped_file_t *, const char *);
void unmap_file(mapped_file_t *);

#endif // MAP_FILE_H_
#endif // MAP_FILE_H
6 changes: 3 additions & 3 deletions src/stlink-lib/md5.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
* MD5 hash function
*/

#ifndef MD5_H_
#define MD5_H_
#ifndef MD5_H
#define MD5_H

#pragma once

Expand Down Expand Up @@ -71,4 +71,4 @@ void Md5Finalise(Md5Context* Context /* [in out] */, MD5_HASH* Digest /* [in] */
*/
void Md5Calculate(void const* Buffer /* [in] */, uint32_t BufferSize /* [in] */, MD5_HASH* Digest /* [in] */);

#endif // MD5_H_
#endif // MD5_H
6 changes: 3 additions & 3 deletions src/stlink-lib/option_bytes.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* Read and write option bytes and option control registers
*/

#ifndef OPTION_BYTES_H_
#define OPTION_BYTES_H_
#ifndef OPTION_BYTES_H
#define OPTION_BYTES_H

#include <stdio.h>
#include <stlink.h>
Expand All @@ -23,4 +23,4 @@ int stlink_write_option_control_register1_32(stlink_t *sl, uint32_t option_cr1);
int stlink_write_option_bytes(stlink_t *sl, stm32_addr_t addr, uint8_t* base, uint32_t len);
int stlink_fwrite_option_bytes(stlink_t *sl, const char* path, stm32_addr_t addr);

#endif // OPTION_BYTES_H_
#endif // OPTION_BYTES_H
6 changes: 3 additions & 3 deletions src/stlink-lib/reg.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef REG_H_
#define REG_H_
#ifndef REG_H
#define REG_H

#define STLINK_REG_CM3_CPUID 0xE000ED00

Expand Down Expand Up @@ -123,4 +123,4 @@
#define STLINK_REG_CM7_ICIALLU 0xE000EF50
#define STLINK_REG_CM7_CCSIDR 0xE000ED80

#endif // REG_H_
#endif // REG_H
6 changes: 3 additions & 3 deletions src/stlink-lib/sg.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Author: karl
*/

#ifndef SG_H_
#define SG_H_
#ifndef SG_H
#define SG_H

#include <stlink.h>
#include <libusb_settings.h>
Expand Down Expand Up @@ -56,4 +56,4 @@ struct stlink_libsg {

stlink_t* stlink_v1_open(const int verbose, int reset);

#endif // SG_H_
#endif // SG_H
6 changes: 3 additions & 3 deletions src/stlink-lib/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Author: karl
*/

#ifndef USB_H_
#define USB_H_
#ifndef USB_H
#define USB_H

#include <stdbool.h>

Expand Down Expand Up @@ -70,4 +70,4 @@ stlink_t *stlink_open_usb(enum ugly_loglevel verbose, enum connect_type connect,
size_t stlink_probe_usb(stlink_t **stdevs[], enum connect_type connect, int freq);
void stlink_probe_usb_free(stlink_t **stdevs[], size_t size);

#endif // USB_H_
#endif // USB_H
6 changes: 3 additions & 3 deletions src/win32/getopt/getopt.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef GETOPT_H_
#define GETOPT_H_
#ifndef GETOPT_H
#define GETOPT_H

#if defined(__cplusplus)
extern "C" {
Expand Down Expand Up @@ -38,4 +38,4 @@ int getopt_long(int argc,
}
#endif

#endif // GETOPT_H_
#endif // GETOPT_H
Loading

0 comments on commit b1c4de6

Please sign in to comment.