From 12370baf22a9ff4e110a2f9565f4cbd053453b40 Mon Sep 17 00:00:00 2001 From: Sander Speetjens Date: Mon, 6 Nov 2023 22:30:29 +0100 Subject: [PATCH] TFTP Format --- project/Core/Inc/tftp.h | 6 +++--- project/Core/Src/tftp.c | 11 +++-------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/project/Core/Inc/tftp.h b/project/Core/Inc/tftp.h index f4b152b..1e3a520 100644 --- a/project/Core/Inc/tftp.h +++ b/project/Core/Inc/tftp.h @@ -7,10 +7,10 @@ #ifndef PROJECT_TFTP_H #define PROJECT_TFTP_H #define LOGGER_LEVEL_ALL -#include "log.h" #include +#include "log.h" -extern struct tftp_context tftpContext_s; +extern struct tftp_context tftpContext_s; void tftp_server_init(void); -#endif //PROJECT_TFTP_H +#endif // PROJECT_TFTP_H diff --git a/project/Core/Src/tftp.c b/project/Core/Src/tftp.c index ddbfc5d..0ca2083 100644 --- a/project/Core/Src/tftp.c +++ b/project/Core/Src/tftp.c @@ -8,11 +8,11 @@ static const char* TAG = "tftp_server"; -void *tftp_open(const char *fname, const char *mode, u8_t write) { +void* tftp_open(const char* fname, const char* mode, u8_t write) { LOG_INFO(TAG, "Opening %s", fname); } -void tftp_close(void *handle) { +void tftp_close(void* handle) { LOG_INFO(TAG, "closing file"); } int tftp_read(void* handle, void* buf, int bytes) { @@ -23,12 +23,7 @@ int tftp_write(void* handle, struct pbuf* p) { LOG_INFO(TAG, "Writing file"); } -struct tftp_context tftpContext_s = { - .open = tftp_open, - .close = tftp_close, - .read = tftp_read, - .write = tftp_write - }; +struct tftp_context tftpContext_s = {.open = tftp_open, .close = tftp_close, .read = tftp_read, .write = tftp_write}; void tftp_server_init(void) { LOG_INFO(TAG, "Initializing tftp server");