Skip to content

Commit

Permalink
Fixing MCC 118 comms issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Wright committed Mar 5, 2019
1 parent 9c6a4c2 commit 1b2249c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/mcc118.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static const char* const spi_device = SPI_DEVICE_0; // the spidev device
static const uint8_t spi_mode = SPI_MODE_1; // use mode 1 (CPOL=0,
// CPHA=1)
static const uint8_t spi_bits = 8; // 8 bits per transfer
static const uint32_t spi_speed = 10000000; // maximum SPI clock
static const uint32_t spi_speed = 9600000; // maximum SPI clock
// frequency
static const uint16_t spi_delay = 0; // delay in us before
// removing CS
Expand Down Expand Up @@ -929,6 +929,7 @@ static void* _scan_thread(void* arg)
}

#define MIN_SLEEP_US 200
#define TRIG_SLEEP_US 1000

done = false;
sleep_us = MIN_SLEEP_US;
Expand Down Expand Up @@ -957,7 +958,7 @@ static void* _scan_thread(void* arg)
else if (info->triggered == 0)
{
// waiting for trigger, use a longer sleep time
sleep_us = 5000;
sleep_us = TRIG_SLEEP_US;
}
else
{
Expand Down
5 changes: 4 additions & 1 deletion version_history.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
1.1.0.2: Fixed an issue with high CPU usage when waiting for a trigger on the
1.1.0.2:
- Fixed an issue with high CPU usage when waiting for a trigger on the
MCC 118 - updated both library and trigger examples.
- Lowered the max SPI clock rate for the MCC 118 to fix communications
issues on some systems.

1.1.0.1: Fixed an issue with resource conflicts when using multiple threads in
the same process (such as using multiple MCC 118s.)
Expand Down

0 comments on commit 1b2249c

Please sign in to comment.