Skip to content

Commit

Permalink
move uni_btstack_version_compat to its own file
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoquesada committed Dec 20, 2024
1 parent 05e3b73 commit fb4daae
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
20 changes: 20 additions & 0 deletions src/components/bluepad32/include/uni_btstack_version_compat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2024 Ricardo Quesada
// http://retro.moe/unijoysticle2

#ifndef UNI_BTSTACK_VERSION_COMPAT_H
#define UNI_BTSTACK_VERSION_COMPAT_H

// btstack_version.h was included in v1.6.2
#if defined __has_include
#if __has_include(<btstack_version.h>)
#include <btstack_version.h>
#else
#define BTSTACK_VERSION_MAJOR 1
#define BTSTACK_VERSION_MINOR 6
#define BTSTACK_VERSION_PATCH 1
#define BTSTACK_VERSION_STRING "1.6.1"
#endif
#endif

#endif // UNI_BTSTACK_VERSION_COMPAT_H
1 change: 1 addition & 0 deletions src/components/bluepad32/parser/uni_hid_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "parser/uni_hid_parser.h"

#include "hid_usage.h"
#include "uni_btstack_version_compat.h"
#include "uni_hid_device.h"
#include "uni_log.h"
#include "uni_version.h"
Expand Down
6 changes: 5 additions & 1 deletion src/components/bluepad32/uni_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "bt/uni_bt_allowlist.h"
#include "bt/uni_bt_setup.h"
#include "platform/uni_platform.h"
#include "uni_btstack_version_compat.h"
#include "uni_config.h"
#include "uni_console.h"
#include "uni_hid_device.h"
Expand All @@ -17,7 +18,10 @@
#include "uni_version.h"
#include "uni_virtual_device.h"

int uni_init(int argc, const char** argv) {
// Move it uni_common.
#define UNI_CONCAT (str1, str2) str1 str2

int uni_init(int argc, const char **argv) {
// Disable stdout buffering
setbuf(stdout, NULL);

Expand Down

0 comments on commit fb4daae

Please sign in to comment.