Rename device4 into device_mcu
Signed-off-by: Jacki <jacki@thejackimonster.de>
This commit is contained in:
parent
776fb7204d
commit
09ad6dc04e
12 changed files with 894 additions and 893 deletions
|
@ -1,5 +1,5 @@
|
|||
|
||||
add_subdirectory(debug_imu)
|
||||
add_subdirectory(debug_d4)
|
||||
add_subdirectory(debug_mcu)
|
||||
|
||||
add_subdirectory(mcu_firmware)
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
void test3(uint64_t timestamp,
|
||||
device_imu_event_type event,
|
||||
const device_imu_ahrs_type* ahrs) {
|
||||
void test(uint64_t timestamp,
|
||||
device_imu_event_type event,
|
||||
const device_imu_ahrs_type* ahrs) {
|
||||
device_imu_quat_type orientation;
|
||||
device_imu_euler_type euler;
|
||||
|
||||
|
@ -47,13 +47,13 @@ void test3(uint64_t timestamp,
|
|||
}
|
||||
|
||||
int main(int argc, const char** argv) {
|
||||
device_imu_type dev3;
|
||||
if (DEVICE_IMU_ERROR_NO_ERROR != device_imu_open(&dev3, test3)) {
|
||||
device_imu_type dev;
|
||||
if (DEVICE_IMU_ERROR_NO_ERROR != device_imu_open(&dev, test)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
device_imu_clear(&dev3);
|
||||
while (DEVICE_IMU_ERROR_NO_ERROR == device_imu_read(&dev3, -1));
|
||||
device_imu_close(&dev3);
|
||||
device_imu_clear(&dev);
|
||||
while (DEVICE_IMU_ERROR_NO_ERROR == device_imu_read(&dev, -1));
|
||||
device_imu_close(&dev);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
project(xrealAirDebugD4 C)
|
||||
project(xrealAirDebugMCU C)
|
||||
|
||||
set(CMAKE_C_STANDARD 17)
|
||||
|
||||
add_executable(
|
||||
xrealAirDebugD4
|
||||
xrealAirDebugMCU
|
||||
src/debug.c
|
||||
)
|
||||
|
||||
target_include_directories(xrealAirDebugD4
|
||||
target_include_directories(xrealAirDebugMCU
|
||||
BEFORE PUBLIC ${XREAL_AIR_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
target_link_libraries(xrealAirDebugD4
|
||||
target_link_libraries(xrealAirDebugMCU
|
||||
${XREAL_AIR_LIBRARY}
|
||||
)
|
|
@ -1,7 +1,7 @@
|
|||
//
|
||||
// Created by thejackimonster on 05.04.23.
|
||||
//
|
||||
// Copyright (c) 2023 thejackimonster. All rights reserved.
|
||||
// Copyright (c) 2023-2024 thejackimonster. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -22,22 +22,22 @@
|
|||
// THE SOFTWARE.
|
||||
//
|
||||
|
||||
#include "device4.h"
|
||||
#include "device_mcu.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void test4(uint64_t timestamp,
|
||||
device4_event_type event,
|
||||
uint8_t brightness,
|
||||
const char* msg) {
|
||||
void test(uint64_t timestamp,
|
||||
device_mcu_event_type event,
|
||||
uint8_t brightness,
|
||||
const char* msg) {
|
||||
switch (event) {
|
||||
case DEVICE4_EVENT_MESSAGE:
|
||||
case DEVICE_MCU_EVENT_MESSAGE:
|
||||
printf("Message: `%s`\n", msg);
|
||||
break;
|
||||
case DEVICE4_EVENT_BRIGHTNESS_UP:
|
||||
case DEVICE_MCU_EVENT_BRIGHTNESS_UP:
|
||||
printf("Increase Brightness: %u\n", brightness);
|
||||
break;
|
||||
case DEVICE4_EVENT_BRIGHTNESS_DOWN:
|
||||
case DEVICE_MCU_EVENT_BRIGHTNESS_DOWN:
|
||||
printf("Decrease Brightness: %u\n", brightness);
|
||||
break;
|
||||
default:
|
||||
|
@ -46,13 +46,13 @@ void test4(uint64_t timestamp,
|
|||
}
|
||||
|
||||
int main(int argc, const char** argv) {
|
||||
device4_type dev4;
|
||||
if (DEVICE4_ERROR_NO_ERROR != device4_open(&dev4, test4)) {
|
||||
device_mcu_type dev;
|
||||
if (DEVICE_MCU_ERROR_NO_ERROR != device_mcu_open(&dev, test)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
device4_clear(&dev4);
|
||||
while (DEVICE4_ERROR_NO_ERROR == device4_read(&dev4, -1));
|
||||
device4_close(&dev4);
|
||||
device_mcu_clear(&dev);
|
||||
while (DEVICE_MCU_ERROR_NO_ERROR == device_mcu_read(&dev, -1));
|
||||
device_mcu_close(&dev);
|
||||
return 0;
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
// THE SOFTWARE.
|
||||
//
|
||||
|
||||
#include "device4.h"
|
||||
#include "device_mcu.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
@ -67,13 +67,13 @@ int main(int argc, const char** argv) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
device4_type dev4;
|
||||
if (DEVICE4_ERROR_NO_ERROR != device4_open(&dev4, NULL)) {
|
||||
device_mcu_type dev;
|
||||
if (DEVICE_MCU_ERROR_NO_ERROR != device_mcu_open(&dev, NULL)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
device4_clear(&dev4);
|
||||
device4_update_mcu_firmware(&dev4, path);
|
||||
device4_close(&dev4);
|
||||
device_mcu_clear(&dev);
|
||||
device_mcu_update_firmware(&dev, path);
|
||||
device_mcu_close(&dev);
|
||||
return 0;
|
||||
}
|
||||
|
|
Reference in a new issue