Specify languages and allow C++ usage
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
This commit is contained in:
parent
c96c9f0f8c
commit
8ea326e429
6 changed files with 34 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(nrealAirLinuxDriver)
|
project(nrealAirLinuxDriver C)
|
||||||
|
|
||||||
set(CMAKE_C_STANDARD 17)
|
set(CMAKE_C_STANDARD 17)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(nrealAirDebugD3)
|
project(nrealAirDebugD3 C)
|
||||||
|
|
||||||
set(CMAKE_C_STANDARD 17)
|
set(CMAKE_C_STANDARD 17)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(nrealAirDebugD4)
|
project(nrealAirDebugD4 C)
|
||||||
|
|
||||||
set(CMAKE_C_STANDARD 17)
|
set(CMAKE_C_STANDARD 17)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(nrealAirLibrary)
|
project(nrealAirLibrary C)
|
||||||
|
|
||||||
set(CMAKE_C_STANDARD 17)
|
set(CMAKE_C_STANDARD 17)
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,19 @@
|
||||||
// THE SOFTWARE.
|
// THE SOFTWARE.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#ifndef __cplusplus
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __cplusplus
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#else
|
||||||
|
#include <cstdint.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
struct __attribute__((__packed__)) device3_packet_t {
|
struct __attribute__((__packed__)) device3_packet_t {
|
||||||
uint8_t signature [2];
|
uint8_t signature [2];
|
||||||
|
@ -133,3 +144,7 @@ device3_quat_type device3_get_orientation(const device3_ahrs_type* ahrs);
|
||||||
device3_vec3_type device3_get_euler(device3_quat_type quat);
|
device3_vec3_type device3_get_euler(device3_quat_type quat);
|
||||||
|
|
||||||
void device3_close(device3_type* device);
|
void device3_close(device3_type* device);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
#endif
|
||||||
|
|
|
@ -23,8 +23,15 @@
|
||||||
// THE SOFTWARE.
|
// THE SOFTWARE.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#ifndef __cplusplus
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __cplusplus
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#else
|
||||||
|
#include <cstdint.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define DEVICE4_ACTION_PASSIVE_POLL_START 0b00010
|
#define DEVICE4_ACTION_PASSIVE_POLL_START 0b00010
|
||||||
#define DEVICE4_ACTION_BRIGHTNESS_COMMAND 0b00011
|
#define DEVICE4_ACTION_BRIGHTNESS_COMMAND 0b00011
|
||||||
|
@ -36,6 +43,10 @@
|
||||||
#define DEVICE4_BUTTON_BRIGHTNESS_UP 0x2
|
#define DEVICE4_BUTTON_BRIGHTNESS_UP 0x2
|
||||||
#define DEVICE4_BUTTON_BRIGHTNESS_DOWN 0x3
|
#define DEVICE4_BUTTON_BRIGHTNESS_DOWN 0x3
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
struct __attribute__((__packed__)) device4_packet_t {
|
struct __attribute__((__packed__)) device4_packet_t {
|
||||||
uint8_t signature;
|
uint8_t signature;
|
||||||
uint32_t checksum;
|
uint32_t checksum;
|
||||||
|
@ -100,3 +111,7 @@ device4_type* device4_open(device4_event_callback callback);
|
||||||
int device4_read(device4_type* device, int timeout);
|
int device4_read(device4_type* device, int timeout);
|
||||||
|
|
||||||
void device4_close(device4_type* device);
|
void device4_close(device4_type* device);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
#endif
|
||||||
|
|
Reference in a new issue