Browse Source

Formatting

pull/1/head
Scott Lahteine 5 years ago
parent
commit
7d8c38693f
  1. 27
      Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/spi.cpp
  2. 3
      buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/variant.cpp
  3. 3
      buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.cpp

27
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/spi.cpp

@ -64,19 +64,10 @@ namespace FTDI {
noInterrupts(); noInterrupts();
for (k = 0; k < 8; k++) { // Output and Read each bit of spiOutByte and spiInByte for (k = 0; k < 8; k++) { // Output and Read each bit of spiOutByte and spiInByte
if (spiOutByte & spiIndex) { // Output MOSI Bit WRITE(CLCD_SOFT_SPI_MOSI, (spiOutByte & spiIndex) ? 1 : 0); // Output MOSI Bit
WRITE(CLCD_SOFT_SPI_MOSI, 1);
}
else {
WRITE(CLCD_SOFT_SPI_MOSI, 0);
}
WRITE(CLCD_SOFT_SPI_SCLK, 1); // Pulse Clock WRITE(CLCD_SOFT_SPI_SCLK, 1); // Pulse Clock
WRITE(CLCD_SOFT_SPI_SCLK, 0); WRITE(CLCD_SOFT_SPI_SCLK, 0);
if (READ(CLCD_SOFT_SPI_MISO)) spiInByte |= spiIndex;
if (READ(CLCD_SOFT_SPI_MISO)) {
spiInByte |= spiIndex;
}
spiIndex >>= 1; spiIndex >>= 1;
} }
interrupts(); interrupts();
@ -86,20 +77,13 @@ namespace FTDI {
#ifdef CLCD_USE_SOFT_SPI #ifdef CLCD_USE_SOFT_SPI
void SPI::_soft_spi_send (uint8_t spiOutByte) { void SPI::_soft_spi_send (uint8_t spiOutByte) {
uint8_t spiIndex = 0x80; uint8_t k, spiIndex = 0x80;
uint8_t k;
noInterrupts(); noInterrupts();
for (k = 0; k < 8; k++) { // Output each bit of spiOutByte for (k = 0; k < 8; k++) { // Output each bit of spiOutByte
if (spiOutByte & spiIndex) { // Output MOSI Bit WRITE(CLCD_SOFT_SPI_MOSI, (spiOutByte & spiIndex) ? 1 : 0); // Output MOSI Bit
WRITE(CLCD_SOFT_SPI_MOSI, 1);
}
else {
WRITE(CLCD_SOFT_SPI_MOSI, 0);
}
WRITE(CLCD_SOFT_SPI_SCLK, 1); // Pulse Clock WRITE(CLCD_SOFT_SPI_SCLK, 1); // Pulse Clock
WRITE(CLCD_SOFT_SPI_SCLK, 0); WRITE(CLCD_SOFT_SPI_SCLK, 0);
spiIndex >>= 1; spiIndex >>= 1;
} }
interrupts(); interrupts();
@ -166,8 +150,7 @@ namespace FTDI {
} }
// Not really a SPI signal... // Not really a SPI signal...
void SPI::test_pulse(void) void SPI::test_pulse(void) {
{
#ifdef CLCD_AUX_0 #ifdef CLCD_AUX_0
WRITE(CLCD_AUX_0, 1); WRITE(CLCD_AUX_0, 1);
delayMicroseconds(10); delayMicroseconds(10);

3
buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/variant.cpp

@ -205,8 +205,7 @@ extern "C" {
* @param None * @param None
* @retval None * @retval None
*/ */
WEAK void SystemClock_Config(void) WEAK void SystemClock_Config(void) {
{
RCC_OscInitTypeDef RCC_OscInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_ClkInitTypeDef RCC_ClkInitStruct;

3
buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.cpp

@ -109,8 +109,7 @@ extern "C" {
* @param None * @param None
* @retval None * @retval None
*/ */
WEAK void SystemClock_Config(void) WEAK void SystemClock_Config(void) {
{
RCC_OscInitTypeDef RCC_OscInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_ClkInitTypeDef RCC_ClkInitStruct;

Loading…
Cancel
Save