Corrected preprocessor header includes

pull/1312/head
nightwalker-87 2023-04-30 18:52:14 +02:00
rodzic 1775184084
commit ab286988b4
29 zmienionych plików z 102 dodań i 83 usunięć

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef STLINK_BACKEND_H_
#define STLINK_BACKEND_H_
#ifndef BACKEND_H_
#define BACKEND_H_
typedef struct _stlink_backend {
void (*close) (stlink_t * sl);
@ -34,4 +34,4 @@
int (*trace_read) (stlink_t * sl, uint8_t* buf, size_t size);
} stlink_backend_t;
#endif // STLINK_BACKEND_H_
#endif // BACKEND_H_

Wyświetl plik

@ -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>
@ -311,4 +311,4 @@ int stlink_target_connect(stlink_t *sl, enum connect_type connect);
}
#endif
#endif // STLINK_H
#endif // STLINK_H_

Wyświetl plik

@ -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 {
@ -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_

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef STM32FLASH_H
#define STM32FLASH_H
#ifndef STM32FLASH_H_
#define STM32FLASH_H_
/* stm32f FPEC flash controller interface, pm0063 manual */
// STM32F05x is identical, based on RM0091 (DM00031936, Doc ID 018940 Rev 2, August 2012)
@ -378,4 +378,4 @@
#define FLASH_H7_OPTSR_CUR (FLASH_H7_REGS_ADDR + 0x1c)
#define FLASH_H7_OPTCCR (FLASH_H7_REGS_ADDR + 0x24)
#endif // STM32FLASH_H
#endif // STM32FLASH_H_

Wyświetl plik

@ -1,9 +1,9 @@
#ifndef STLINK_VERSION_H_
#define STLINK_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 // STLINK_VERSION_H_
#endif // VERSION_H_

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef STLINK_TOOLS_FLASH_H_
#define STLINK_TOOLS_FLASH_H_
#ifndef FLASH_H_
#define FLASH_H_
#include <stdint.h>
@ -33,4 +33,4 @@ struct flash_opts {
int flash_get_opts(struct flash_opts* o, int ac, char** av);
#endif // STLINK_FLASH_H_
#endif // FLASH_H_

Wyświetl plik

@ -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_

Wyświetl plik

@ -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)
@ -8,4 +8,4 @@
#define DEBUG_LOGGING_LEVEL 100
#define DEFAULT_GDB_LISTEN_PORT 4242
#endif // _GDB_SERVER_H
#endif // GDB_SERVER_H_

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef _SEMIHOSTING_H_
#define _SEMIHOSTING_H_
#ifndef SEMIHOSTING_H_
#define SEMIHOSTING_H_
#include <stlink.h>
@ -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_

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef __STLINK_GUI_H__
#define __STLINK_GUI_H__
#ifndef GUI_H_
#define GUI_H_
#include <glib-object.h>
@ -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 // __STLINK_GUI_H__
#endif // GUI_H_

Wyświetl plik

@ -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_

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef STLINK_CHIPID_H_
#define STLINK_CHIPID_H_
#ifndef CHIPID_H_
#define CHIPID_H_
#include <stm32.h>
#include <stlink.h>
@ -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 // STLINK_CHIPID_H_
#endif // CHIPID_H_

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef STLINK_COMMANDS_H_
#define STLINK_COMMANDS_H_
#ifndef COMMANDS_H_
#define COMMANDS_H_
enum stlink_commands {
STLINK_GET_VERSION = 0xF1,
@ -54,4 +54,4 @@ enum stlink_dfu_commands {
STLINK_DFU_EXIT = 0x07
};
#endif // STLINK_COMMANDS_H_
#endif // COMMANDS_H_

Wyświetl plik

@ -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_

Wyświetl plik

@ -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 *);
@ -24,4 +24,5 @@ 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 // STLINK_H
#endif // COMMON_FLASH_H_

Wyświetl plik

@ -4,8 +4,8 @@
* Flash loader
*/
#ifndef STLINK_FLASH_LOADER_H_
#define STLINK_FLASH_LOADER_H_
#ifndef FLASH_LOADER_H_
#define FLASH_LOADER_H_
#include <stdio.h>
#include <stdint.h>
@ -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 // STLINK_FLASH_LOADER_H_
#endif // FLASH_LOADER_H_

Wyświetl plik

@ -1,8 +1,8 @@
#ifndef SYS_HELPER_H
#define SYS_HELPER_H
#ifndef HELPER_H_
#define HELPER_H_
unsigned time_ms();
int arg_parse_freq(const char *str);
#endif /* SYS_HELPER_H */
#endif // HELPER_H_

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef LIBUSB_SETTINGS_H
#define LIBUSB_SETTINGS_H
#ifndef LIBUSB_SETTINGS_H_
#define LIBUSB_SETTINGS_H_
#include <libusb.h>
@ -44,4 +44,4 @@
#error unsupported libusb version
#endif
#endif // LIBUSB_SETTINGS_H
#endif // LIBUSB_SETTINGS_H_

Wyświetl plik

@ -2,8 +2,8 @@
* Ugly, low performance, configurable level, logging "framework"
*/
#ifndef UGLYLOGGING_H
#define UGLYLOGGING_H
#ifndef LOGGING_H_
#define LOGGING_H_
#ifdef __cplusplus
extern "C" {
@ -45,4 +45,4 @@ int ugly_libusb_log_level(enum ugly_loglevel v);
}
#endif
#endif // UGLYLOGGING_H
#endif // LOGGING_H_

Wyświetl plik

@ -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
@ -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_

Wyświetl plik

@ -5,6 +5,15 @@
* This is free and unencumbered software released into the public domain - June 2013 - waterjuice.org
*/
/*
* File: md5.h
*
* MD5 hash function
*/
#ifndef MD5_H_
#define MD5_H_
#pragma once
#include <stdint.h>
@ -61,3 +70,5 @@ void Md5Finalise(Md5Context* Context /* [in out] */, MD5_HASH* Digest /* [in] */
* Calculates the MD5 hash of the buffer.
*/
void Md5Calculate(void const* Buffer /* [in] */, uint32_t BufferSize /* [in] */, MD5_HASH* Digest /* [in] */);
#endif // MD5_H_

Wyświetl plik

@ -4,6 +4,9 @@
* Read and write option bytes and option control registers
*/
#ifndef OPTION_BYTES_H_
#define OPTION_BYTES_H_
#include <stdio.h>
#include <stlink.h>
@ -19,3 +22,5 @@ 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_

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef STLINK_REG_H_
#define STLINK_REG_H_
#ifndef REG_H_
#define REG_H_
#define STLINK_REG_CM3_CPUID 0xE000ED00
@ -123,4 +123,4 @@
#define STLINK_REG_CM7_ICIALLU 0xE000EF50
#define STLINK_REG_CM7_CCSIDR 0xE000ED80
#endif // STLINK_REG_H_
#endif // REG_H_

Wyświetl plik

@ -3,8 +3,8 @@
* Author: karl
*/
#ifndef STLINK_SG_H
#define STLINK_SG_H
#ifndef SG_H_
#define SG_H_
#include <stlink.h>
#include <libusb_settings.h>
@ -56,4 +56,4 @@ struct stlink_libsg {
stlink_t* stlink_v1_open(const int verbose, int reset);
#endif // STLINK_SG_H
#endif // SG_H_

Wyświetl plik

@ -3,8 +3,8 @@
* Author: karl
*/
#ifndef STLINK_USB_H
#define STLINK_USB_H
#ifndef USB_H_
#define USB_H_
#include <stdbool.h>
@ -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 // STLINK_USB_H
#endif // USB_H_

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef INCLUDED_GETOPT_PORT_H
#define INCLUDED_GETOPT_PORT_H
#ifndef GETOPT_H_
#define GETOPT_H_
#if defined(__cplusplus)
extern "C" {
@ -38,4 +38,4 @@ int getopt_long(int argc,
}
#endif
#endif // INCLUDED_GETOPT_PORT_H
#endif // GETOPT_H_

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef STLINK_MMAP_H
#define STLINK_MMAP_H
#ifndef MMAP_H_
#define MMAP_H_
#ifdef STLINK_HAVE_SYS_MMAN_H
#include <sys/mman.h>
@ -16,6 +16,6 @@
void *mmap(void *addr, size_t len, int prot, int flags, int fd, long long offset);
int munmap(void *addr, size_t len);
#endif /* HAVE_SYS_MMAN_H */
#endif // STLINK_HAVE_SYS_MMAN_H
#endif /* STLINK_MMAP_H */
#endif // MMAP_H_

Wyświetl plik

@ -1,8 +1,10 @@
#ifndef STLINK_TIME_H
#define STLINK_TIME_H
#ifndef SYS_TIME_H_
#define SYS_TIME_H_
#ifdef STLINK_HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <windows.h>
@ -14,6 +16,6 @@ struct timezone {
int gettimeofday(struct timeval *tv, struct timezone *tz);
#endif /* STLINK_HAVE_SYS_TIME_H */
#endif // STLINK_HAVE_SYS_TIME_H
#endif /* STLINK_TIME_H */
#endif // SYS_TIME_H_

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef _UNISTD_H
#define _UNISTD_H 1
#ifndef UNISTD_H_
#define UNISTD_H_
/*
* This file intended to serve as a drop-in replacement for unistd.h on Windows
@ -72,4 +72,4 @@ typedef unsigned __int64 uint64_t;
int usleep(unsigned int waitTime);
#endif
#endif // _UNISTD_H
#endif // UNISTD_H_