| 70 | } |
| 71 | |
| 72 | int PIEEGBoard::start_stream (int buffer_size, const char *streamer_params) |
| 73 | { |
| 74 | if (keep_alive) |
| 75 | { |
| 76 | safe_logger (spdlog::level::err, "Streaming thread already running"); |
| 77 | return (int)BrainFlowExitCodes::STREAM_ALREADY_RUN_ERROR; |
| 78 | } |
| 79 | int res = prepare_for_acquisition (buffer_size, streamer_params); |
| 80 | if (res != (int)BrainFlowExitCodes::STATUS_OK) |
| 81 | { |
| 82 | return res; |
| 83 | } |
| 84 | |
| 85 | int spi_res = write_reg (0x14, 0x80); // led |
| 86 | if (spi_res == (int)BrainFlowExitCodes::STATUS_OK) |
| 87 | { |
| 88 | spi_res = write_reg (0x05, 0x00); // ch1 |
| 89 | } |
| 90 | if (spi_res == (int)BrainFlowExitCodes::STATUS_OK) |
| 91 | { |
| 92 | spi_res = write_reg (0x06, 0x0); // ch2 |
| 93 | } |
| 94 | if (spi_res == (int)BrainFlowExitCodes::STATUS_OK) |
| 95 | { |
| 96 | spi_res = write_reg (0x07, 0x00); // ch3 |
| 97 | } |
| 98 | if (spi_res == (int)BrainFlowExitCodes::STATUS_OK) |
| 99 | { |
| 100 | spi_res = write_reg (0x08, 0x00); // ch4 |
| 101 | } |
| 102 | if (spi_res == (int)BrainFlowExitCodes::STATUS_OK) |
| 103 | { |
| 104 | spi_res = write_reg (0x09, 0x00); // ch5 |
| 105 | } |
| 106 | if (spi_res == (int)BrainFlowExitCodes::STATUS_OK) |
| 107 | { |
| 108 | spi_res = write_reg (0x0A, 0x00); // ch6 |
| 109 | } |
| 110 | if (spi_res == (int)BrainFlowExitCodes::STATUS_OK) |
| 111 | { |
| 112 | spi_res = write_reg (0x0B, 0x00); // ch7 |
| 113 | } |
| 114 | if (spi_res == (int)BrainFlowExitCodes::STATUS_OK) |
| 115 | { |
| 116 | spi_res = write_reg (0x0C, 0x00); // ch8 |
| 117 | } |
| 118 | if (spi_res == (int)BrainFlowExitCodes::STATUS_OK) |
| 119 | { |
| 120 | spi_res = write_reg (0x15, 0x20); // mics |
| 121 | } |
| 122 | if (spi_res == (int)BrainFlowExitCodes::STATUS_OK) |
| 123 | { |
| 124 | spi_res = write_reg (0x01, 0x96); // reg1 |
| 125 | } |
| 126 | if (spi_res == (int)BrainFlowExitCodes::STATUS_OK) |
| 127 | { |
| 128 | spi_res = write_reg (0x02, 0xD4); // reg2 |
| 129 | } |
nothing calls this directly
no test coverage detected