-
-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for PiEEG #723
Changes from all commits
78d466e
d71c0aa
6c4b400
29e575b
587c0e5
2959c4d
acdda10
9a49ca9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,5 +58,6 @@ | |
AAVAA_V3_BOARD(53) | ||
EXPLORE_PLUS_8_CHAN_BOARD(54) | ||
EXPLORE_PLUS_32_CHAN_BOARD(55) | ||
PIEEG_BOARD(60) | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,7 @@ SET (BOARD_CONTROLLER_SRC | |
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/emotibit/emotibit.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/ntl/ntl_wifi.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/aavaa/aavaa_v3.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/pieeg/pieeg_board.cpp | ||
) | ||
|
||
include (${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/ant_neuro/build.cmake) | ||
|
@@ -97,7 +98,9 @@ if (BUILD_OYMOTION_SDK) | |
endif (BUILD_OYMOTION_SDK) | ||
|
||
if (BUILD_BLUETOOTH) | ||
include (${CMAKE_CURRENT_SOURCE_DIR}/src/utils/bluetooth/build.cmake) | ||
if (NOT ANDROID) | ||
include (${CMAKE_CURRENT_SOURCE_DIR}/src/utils/bluetooth/build.cmake) | ||
endif (NOT ANDROID) | ||
endif (BUILD_BLUETOOTH) | ||
|
||
if (BUILD_BLE) | ||
|
@@ -140,6 +143,7 @@ target_include_directories ( | |
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/emotibit/inc | ||
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/ntl/inc | ||
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/aavaa/inc | ||
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/pieeg/inc | ||
) | ||
|
||
target_compile_definitions(${BOARD_CONTROLLER_NAME} PRIVATE NOMINMAX BRAINFLOW_VERSION=${BRAINFLOW_VERSION}) | ||
|
@@ -151,6 +155,22 @@ set_target_properties (${BOARD_CONTROLLER_NAME} | |
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled | ||
) | ||
|
||
find_package(Threads REQUIRED) | ||
|
||
if (ANDROID) | ||
find_library(log-lib log) | ||
target_link_libraries(${BOARD_CONTROLLER_NAME} PRIVATE ${log-lib}) | ||
else() | ||
target_link_libraries(${BOARD_CONTROLLER_NAME} PRIVATE pthread dl) | ||
endif (ANDROID) | ||
|
||
if (BUILD_PERIPHERY) | ||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/periphery) | ||
target_compile_definitions(${BOARD_CONTROLLER_NAME} PRIVATE USE_PERIPHERY) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/periphery) | ||
target_link_libraries(${BOARD_CONTROLLER_NAME} PRIVATE periphery ${CMAKE_THREAD_LIBS_INIT} dl) | ||
endif (BUILD_PERIPHERY) | ||
|
||
if (USE_LIBFTDI) | ||
find_package (LibFTDI1 NO_MODULE) | ||
if (LibFTDI1_FOUND) | ||
|
@@ -231,10 +251,6 @@ endif (ANDROID) | |
if (UNIX AND NOT ANDROID) | ||
target_link_libraries (${BOARD_CONTROLLER_NAME} PRIVATE pthread dl) | ||
endif (UNIX AND NOT ANDROID) | ||
if (ANDROID) | ||
find_library (log-lib log) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is it removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restored find_library for 'log-lib' to ensure proper Android linking. |
||
target_link_libraries (${BOARD_CONTROLLER_NAME} PRIVATE log) | ||
endif (ANDROID) | ||
|
||
install ( | ||
FILES | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <thread> | ||
|
||
#include "board.h" | ||
#include "board_controller.h" | ||
#include "math.h" | ||
#include "socket_server_tcp.h" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why does it need socket? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the unnecessary socket_server_tcp.h inclusion. |
||
|
||
#ifdef USE_PERIPHERY | ||
#include "gpio.h" | ||
#include "spi.h" | ||
#endif | ||
|
||
class PIEEGBoard : public Board | ||
{ | ||
protected: | ||
#ifdef USE_PERIPHERY | ||
volatile bool keep_alive; | ||
bool initialized; | ||
std::thread streaming_thread; | ||
spi_t *spi; | ||
gpio_t *gpio_in; | ||
SocketServerTCP *server_socket; | ||
void read_thread (); | ||
int write_reg (uint8_t reg_address, uint8_t val); | ||
int send_command (uint8_t command); | ||
#endif | ||
|
||
public: | ||
PIEEGBoard (int board_id, struct BrainFlowInputParams params); | ||
~PIEEGBoard (); | ||
|
||
int prepare_session (); | ||
int start_stream (int buffer_size, const char *streamer_params); | ||
int stop_stream (); | ||
int release_session (); | ||
int config_board (std::string config, std::string &response); | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these code style changes are not related to pieeg, and should be reverted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted the code style changes not related to PIEEG as requested.