Simplify more feature driver defines (#22090)
This commit is contained in:
		
							parent
							
								
									61702b2564
								
							
						
					
					
						commit
						21ed9b4575
					
				
					 51 changed files with 63 additions and 62 deletions
				
			
		| 
						 | 
				
			
			@ -66,7 +66,7 @@
 | 
			
		|||
#endif
 | 
			
		||||
 | 
			
		||||
// WS2812-style LED control on pin A10
 | 
			
		||||
#ifdef WS2812_DRIVER_PWM
 | 
			
		||||
#ifdef WS2812_PWM
 | 
			
		||||
#    ifndef WS2812_DI_PIN
 | 
			
		||||
#        define WS2812_DI_PIN PAL_LINE(GPIOA, 10)
 | 
			
		||||
#    endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,7 +32,7 @@
 | 
			
		|||
#    endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef WS2812_DRIVER_PWM
 | 
			
		||||
#ifdef WS2812_PWM
 | 
			
		||||
#    ifndef HAL_USE_PWM
 | 
			
		||||
#        define HAL_USE_PWM TRUE
 | 
			
		||||
#    endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -10,7 +10,7 @@
 | 
			
		|||
#include <hal.h>
 | 
			
		||||
 | 
			
		||||
// TODO: resolve/remove build warnings
 | 
			
		||||
#if defined(RGBLIGHT_ENABLE) && defined(RGBLED_SPLIT) && defined(PROTOCOL_CHIBIOS) && defined(WS2812_DRIVER_BITBANG)
 | 
			
		||||
#if defined(RGBLIGHT_ENABLE) && defined(RGBLED_SPLIT) && defined(PROTOCOL_CHIBIOS) && defined(WS2812_BITBANG)
 | 
			
		||||
#    warning "RGBLED_SPLIT not supported with bitbang WS2812 driver"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,8 +6,8 @@
 | 
			
		|||
/* Adapted from https://github.com/gamazeps/ws2812b-chibios-SPIDMA/ */
 | 
			
		||||
 | 
			
		||||
// Define the spi your LEDs are plugged to here
 | 
			
		||||
#ifndef WS2812_SPI
 | 
			
		||||
#    define WS2812_SPI SPID1
 | 
			
		||||
#ifndef WS2812_SPI_DRIVER
 | 
			
		||||
#    define WS2812_SPI_DRIVER SPID1
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef WS2812_SPI_MOSI_PAL_MODE
 | 
			
		||||
| 
						 | 
				
			
			@ -179,11 +179,11 @@ void ws2812_init(void) {
 | 
			
		|||
#endif
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    spiAcquireBus(&WS2812_SPI);     /* Acquire ownership of the bus.    */
 | 
			
		||||
    spiStart(&WS2812_SPI, &spicfg); /* Setup transfer parameters.       */
 | 
			
		||||
    spiSelect(&WS2812_SPI);         /* Slave Select assertion.          */
 | 
			
		||||
    spiAcquireBus(&WS2812_SPI_DRIVER);     /* Acquire ownership of the bus.    */
 | 
			
		||||
    spiStart(&WS2812_SPI_DRIVER, &spicfg); /* Setup transfer parameters.       */
 | 
			
		||||
    spiSelect(&WS2812_SPI_DRIVER);         /* Slave Select assertion.          */
 | 
			
		||||
#ifdef WS2812_SPI_USE_CIRCULAR_BUFFER
 | 
			
		||||
    spiStartSend(&WS2812_SPI, ARRAY_SIZE(txbuf), txbuf);
 | 
			
		||||
    spiStartSend(&WS2812_SPI_DRIVER, ARRAY_SIZE(txbuf), txbuf);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -202,9 +202,9 @@ void ws2812_setleds(rgb_led_t* ledarray, uint16_t leds) {
 | 
			
		|||
    // Instead spiSend can be used to send synchronously (or the thread logic can be added back).
 | 
			
		||||
#ifndef WS2812_SPI_USE_CIRCULAR_BUFFER
 | 
			
		||||
#    ifdef WS2812_SPI_SYNC
 | 
			
		||||
    spiSend(&WS2812_SPI, ARRAY_SIZE(txbuf), txbuf);
 | 
			
		||||
    spiSend(&WS2812_SPI_DRIVER, ARRAY_SIZE(txbuf), txbuf);
 | 
			
		||||
#    else
 | 
			
		||||
    spiStartSend(&WS2812_SPI, ARRAY_SIZE(txbuf), txbuf);
 | 
			
		||||
    spiStartSend(&WS2812_SPI_DRIVER, ARRAY_SIZE(txbuf), txbuf);
 | 
			
		||||
#    endif
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue