From 4096cf95485229d985efd260cb4fbee687ae2c80 Mon Sep 17 00:00:00 2001 From: Miroslav Ondra Date: Mon, 19 Aug 2019 18:23:29 +0200 Subject: [PATCH] fix spi baudrate to 6MHz on arm64. H5 can set only 6MHz or 12MHz --- modules/unipi/src/unipi_common.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/unipi/src/unipi_common.h b/modules/unipi/src/unipi_common.h index 603456b..5a79c20 100644 --- a/modules/unipi/src/unipi_common.h +++ b/modules/unipi/src/unipi_common.h @@ -64,7 +64,14 @@ #define NEURONSPI_B_PER_WORD 8 #define NEURONSPI_DEFAULT_FREQ 600000 #define NEURONSPI_COMMON_FREQ 12000000 -#define NEURONSPI_SLOWER_FREQ 7500000 + +#if defined(CONFIG_ARM64) +/* on NanoPi there are only 12MHz and 6MHz available, not in between */ + #define NEURONSPI_SLOWER_FREQ 6000000 +#else + #define NEURONSPI_SLOWER_FREQ 7500000 +#endif + #define NEURONSPI_MAX_TX 60 //#define NEURONSPI_MAX_TX 256 #define NEURONSPI_MAX_BAUD 115200 -- 2.34.1