Skip to content

Commit 7cae3fe

Browse files
committed
Fix HID usage
1 parent 0217f74 commit 7cae3fe

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

drivers/weather/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,5 @@ SET(hitechweather_SRC
9595
hitechweather.cpp)
9696

9797
add_executable(indi_hitech_weather ${hitechweather_SRC})
98-
target_link_libraries(indi_hitech_weather indidriver indi_hid ${USB1_LIBRARIES})
98+
target_link_libraries(indi_hitech_weather indidriver ${HIDAPILIB})
9999
install(TARGETS indi_hitech_weather RUNTIME DESTINATION bin)

drivers/weather/hitechweather.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@
2525
#pragma once
2626

2727
#include "indiweather.h"
28-
#include "indi_hidapi.h"
28+
29+
#ifdef _USE_SYSTEM_HIDAPILIB
30+
#include <hidapi/hidapi.h>
31+
#else
32+
#include <indi_hidapi.h>
33+
#endif
2934

3035
class HitechWeather : public INDI::Weather
3136
{
@@ -50,11 +55,11 @@ class HitechWeather : public INDI::Weather
5055
// HiTech Weather USB identifiers
5156
static constexpr unsigned short HITECH_VID = 0x04D8;
5257
static constexpr unsigned short HITECH_PID = 0xF772;
53-
58+
5459
// Command bytes
5560
static constexpr unsigned char CMD_GET_SKY_TEMP = 0x50;
5661
static constexpr unsigned char CMD_GET_AMBIENT = 0x5A;
57-
62+
5863
// Helper functions
5964
bool getSkyTemperature(double &skyTemp);
6065
bool getAmbientTemperature(double &ambientTemp);

0 commit comments

Comments
 (0)