From 5e9bf95ccc46fea80de80ec79a9351730624f5b0 Mon Sep 17 00:00:00 2001 From: devsaurus Date: Wed, 16 Dec 2015 22:23:04 +0100 Subject: [PATCH] cpol=high is not implemented due to insufficient hw docs --- app/modules/spi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/modules/spi.c b/app/modules/spi.c index 6074ec82..c7453e7d 100644 --- a/app/modules/spi.c +++ b/app/modules/spi.c @@ -33,6 +33,10 @@ static int spi_setup( lua_State *L ) if (cpol != PLATFORM_SPI_CPOL_LOW && cpol != PLATFORM_SPI_CPOL_HIGH) { return luaL_error( L, "wrong arg type" ); } + // CPOL_HIGH is not implemented, see app/driver/spi.c spi_master_init() + if (cpol == PLATFORM_SPI_CPOL_HIGH) { + return luaL_error( L, "cpol=high is not implemented" ); + } if (cpha != PLATFORM_SPI_CPHA_LOW && cpha != PLATFORM_SPI_CPHA_HIGH) { return luaL_error( L, "wrong arg type" );