Skip to content

Commit

Permalink
Removed "PC Debug" platform
Browse files Browse the repository at this point in the history
the "pc debug" code uses a "custom" platform instead.
  • Loading branch information
ricardoquesada committed Nov 10, 2023
1 parent b34ea21 commit 0f9da11
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 39 deletions.
2 changes: 0 additions & 2 deletions docs/adding_new_platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ Finally in [uni_platform.c] add support for your platform. E.g:
void uni_platform_init(int argc, const char** argv) {
#ifdef CONFIG_BLUEPAD32_PLATFORM_UNIJOYSTICLE
_platform = uni_platform_unijoysticle_create();
#elif defined(CONFIG_BLUEPAD32_PLATFORM_PC_DEBUG)
_platform = uni_platform_pc_debug_create();
#elif defined(CONFIG_BLUEPAD32_PLATFORM_AIRLIFT)
_platform = uni_platform_airlift_create();
#elif defined(CONFIG_BLUEPAD32_PLATFORM_MIGHTYMIGGY)
Expand Down
2 changes: 1 addition & 1 deletion external/btstack
Submodule btstack updated 686 files
1 change: 0 additions & 1 deletion src/components/bluepad32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ set(srcs "uni_balance_board.c"
"uni_platform.c"
"uni_platform_arduino.c"
"uni_platform_arduino_bootstrap.cpp"
"uni_platform_pc_debug.c"
"uni_property.c"
"uni_utils.c"
"uni_virtual_device.c")
Expand Down
26 changes: 0 additions & 26 deletions src/components/bluepad32/include/uni_platform_pc_debug.h

This file was deleted.

3 changes: 0 additions & 3 deletions src/components/bluepad32/uni_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ limitations under the License.
#include "uni_platform_custom.h"
#include "uni_platform_mightymiggy.h"
#include "uni_platform_nina.h"
#include "uni_platform_pc_debug.h"

#ifdef CONFIG_BLUEPAD32_PLATFORM_UNIJOYSTICLE
#include "uni_platform_unijoysticle.h"
Expand All @@ -44,8 +43,6 @@ void uni_platform_init(int argc, const char** argv) {

#ifdef CONFIG_BLUEPAD32_PLATFORM_UNIJOYSTICLE
_platform = uni_platform_unijoysticle_create();
#elif defined(CONFIG_BLUEPAD32_PLATFORM_PC_DEBUG)
_platform = uni_platform_pc_debug_create();
#elif defined(CONFIG_BLUEPAD32_PLATFORM_AIRLIFT)
_platform = uni_platform_airlift_create();
#elif defined(CONFIG_BLUEPAD32_PLATFORM_MIGHTYMIGGY)
Expand Down
4 changes: 2 additions & 2 deletions src/components/bluepad32/uni_property_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ limitations under the License.
#include "uni_common.h"

// TODO: Implement a memory cache.
// Used only in PC_DEBUG configuration.
// Used only in non-ESP32 platforms.
// Short-term solution: just return the default value.

void uni_property_mem_set(const char* key, uni_property_type_t type, uni_property_value_t value) {
Expand All @@ -40,4 +40,4 @@ uni_property_value_t uni_property_mem_get(const char* key, uni_property_type_t t

void uni_property_mem_init(void) {
/* Nothing */
}
}
5 changes: 2 additions & 3 deletions tools/pc_debug/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
BTSTACK_ROOT = ../../external/btstack
BLUEPAD32_ROOT = ../../src/components/bluepad32

CORE += main.c btstack_stdin_posix.c btstack_tlv_posix.c hci_dump_posix_fs.c
CORE += main.c my_platform.c btstack_stdin_posix.c btstack_tlv_posix.c hci_dump_posix_fs.c

COMMON += hci_transport_h2_libusb.c btstack_run_loop_posix.c le_device_db_tlv.c btstack_link_key_db_tlv.c wav_util.c btstack_network_posix.c
COMMON += gatt_client.c att_dispatch.c hids_client.c device_information_service_client.c scan_parameters_service_client.c hid_host.c
COMMON += btstack_audio_portaudio.c btstack_chipset_zephyr.c rijndael.c hid_device.c

include ${BTSTACK_ROOT}/example/Makefile.inc

CFLAGS += -DCONFIG_BLUEPAD32_PLATFORM_PC_DEBUG
CFLAGS += -DCONFIG_BLUEPAD32_PLATFORM_CUSTOM

CC ?= clang
CFLAGS += -g -std=c99 -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wunused-parameter -Wredundant-decls -Wsign-compare -Wswitch-default
Expand Down Expand Up @@ -107,7 +107,6 @@ bluepad32: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} btstack_ring_b
${BLUEPAD32_ROOT}/uni_main.o \
${BLUEPAD32_ROOT}/uni_mouse.o \
${BLUEPAD32_ROOT}/uni_platform.o \
${BLUEPAD32_ROOT}/uni_platform_pc_debug.o \
${BLUEPAD32_ROOT}/uni_property.o \
${BLUEPAD32_ROOT}/uni_property_mem.o \
${BLUEPAD32_ROOT}/uni_utils.o \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ limitations under the License.
#include <string.h>

#include "uni_bt.h"
#include "uni_error.h"
#include "uni_gamepad.h"
#include "uni_hid_device.h"
#include "uni_hid_parser_mouse.h"
#include "uni_log.h"
#include "uni_platform.h"

//
// Globals
Expand Down Expand Up @@ -211,7 +213,7 @@ static void trigger_event_on_gamepad(uni_hid_device_t* d) {
//
// Entry Point
//
struct uni_platform* uni_platform_pc_debug_create(void) {
struct uni_platform* uni_platform_custom_create(void) {
static struct uni_platform plat = {
.name = "PC Debug",
.init = pc_debug_init,
Expand Down

0 comments on commit 0f9da11

Please sign in to comment.