diff options
author | Daniel Garcia <danielgarcia@gmail.com> | 2016-01-23 23:35:46 +0300 |
---|---|---|
committer | Daniel Garcia <danielgarcia@gmail.com> | 2016-01-23 23:35:46 +0300 |
commit | 588e08ba9d99f83852b9f3320eb4ac9bbc256fe1 (patch) | |
tree | 8463925549c4a1ef02decc9e5c2b4e4b72ba5cdc | |
parent | 45b804fe04c3e02ba85d5eb63e9daf4d83dd432b (diff) |
Swap MPC template argument ordering to prep for merging the pixel/multi pixel controllers
-rw-r--r-- | controller.h | 2 | ||||
-rw-r--r-- | platforms/arm/k20/clockless_block_arm_k20.h | 16 | ||||
-rw-r--r-- | platforms/arm/k20/octows2811_controller.h | 2 | ||||
-rw-r--r-- | platforms/arm/sam/clockless_block_arm_sam.h | 8 |
4 files changed, 14 insertions, 14 deletions
diff --git a/controller.h b/controller.h index 06d3c47e..3c907395 100644 --- a/controller.h +++ b/controller.h @@ -354,7 +354,7 @@ struct PixelController { // Pixel controller class. This is the class that we use to centralize pixel access in a block of data, including // support for things like RGB reordering, scaling, dithering, skipping (for ARGB data), and eventually, we will // centralize 8/12/16 conversions here as well. -template<int LANES,int MASK, EOrder RGB_ORDER> +template<EOrder RGB_ORDER, int LANES=1, uint32_t MASK=0xFFFFFFFF> struct MultiPixelController { const uint8_t *mData; int mLen,mLenRemaining; diff --git a/platforms/arm/k20/clockless_block_arm_k20.h b/platforms/arm/k20/clockless_block_arm_k20.h index 5be19909..f0df1d34 100644 --- a/platforms/arm/k20/clockless_block_arm_k20.h +++ b/platforms/arm/k20/clockless_block_arm_k20.h @@ -70,7 +70,7 @@ public: // set all the leds on the controller to a given color virtual void showColor(const struct CRGB & rgbdata, int nLeds, CRGB scale) { - MultiPixelController<LANES,PORT_MASK,RGB_ORDER> pixels(rgbdata,nLeds, scale, getDither() ); + MultiPixelController<RGB_ORDER,LANES,PORT_MASK> pixels(rgbdata,nLeds, scale, getDither() ); mWait.wait(); uint32_t clocks = showRGBInternal(pixels,nLeds); #if FASTLED_ALLOW_INTTERUPTS == 0 @@ -83,7 +83,7 @@ public: } virtual void show(const struct CRGB *rgbdata, int nLeds, CRGB scale) { - MultiPixelController<LANES,PORT_MASK,RGB_ORDER> pixels(rgbdata,nLeds, scale, getDither() ); + MultiPixelController<RGB_ORDER,LANES,PORT_MASK> pixels(rgbdata,nLeds, scale, getDither() ); mWait.wait(); uint32_t clocks = showRGBInternal(pixels,nLeds); #if FASTLED_ALLOW_INTTERUPTS == 0 @@ -103,7 +103,7 @@ public: uint32_t raw[3]; } Lines; - template<int BITS,int PX> __attribute__ ((always_inline)) inline static void writeBits(register uint32_t & next_mark, register Lines & b, MultiPixelController<LANES, PORT_MASK, RGB_ORDER> &pixels) { // , register uint32_t & b2) { + template<int BITS,int PX> __attribute__ ((always_inline)) inline static void writeBits(register uint32_t & next_mark, register Lines & b, MultiPixelController<RGB_ORDER, LANES, PORT_MASK> &pixels) { // , register uint32_t & b2) { register Lines b2; if(LANES>8) { transpose8<1,2>(b.bytes,b2.bytes); @@ -175,7 +175,7 @@ public: // This method is made static to force making register Y available to use for data on AVR - if the method is non-static, then // gcc will use register Y for the this pointer. - static uint32_t showRGBInternal(MultiPixelController<LANES, PORT_MASK, RGB_ORDER> &allpixels, int nLeds) { + static uint32_t showRGBInternal(MultiPixelController<RGB_ORDER, LANES, PORT_MASK> &allpixels, int nLeds) { // Get access to the clock ARM_DEMCR |= ARM_DEMCR_TRCENA; ARM_DWT_CTRL |= ARM_DWT_CTRL_CYCCNTENA; @@ -267,14 +267,14 @@ public: // set all the leds on the controller to a given color virtual void showColor(const struct CRGB & rgbdata, int nLeds, CRGB scale) { - MultiPixelController<DLANES,PMASK,RGB_ORDER> pixels(rgbdata,nLeds, scale, getDither() ); + MultiPixelController<RGB_ORDER,DLANES,PMASK> pixels(rgbdata,nLeds, scale, getDither() ); mWait.wait(); showRGBInternal(pixels,nLeds); mWait.mark(); } virtual void show(const struct CRGB *rgbdata, int nLeds, CRGB scale) { - MultiPixelController<DLANES,PMASK,RGB_ORDER> pixels(rgbdata,nLeds, scale, getDither() ); + MultiPixelController<RGB_ORDER,DLANES,PMASK> pixels(rgbdata,nLeds, scale, getDither() ); mWait.wait(); showRGBInternal(pixels,nLeds); mWait.mark(); @@ -286,7 +286,7 @@ public: uint32_t raw[4]; } Lines; - template<int BITS,int PX> __attribute__ ((always_inline)) inline static void writeBits(register uint32_t & next_mark, register Lines & b, MultiPixelController<DLANES, PMASK, RGB_ORDER> &pixels) { // , register uint32_t & b2) { + template<int BITS,int PX> __attribute__ ((always_inline)) inline static void writeBits(register uint32_t & next_mark, register Lines & b, MultiPixelController<RGB_ORDER,DLANES, PMASK> &pixels) { // , register uint32_t & b2) { register Lines b2; transpose8x1(b.bytes,b2.bytes); transpose8x1(b.bytes+8,b2.bytes+8); @@ -318,7 +318,7 @@ public: // This method is made static to force making register Y available to use for data on AVR - if the method is non-static, then // gcc will use register Y for the this pointer. - static uint32_t showRGBInternal(MultiPixelController<DLANES, PMASK, RGB_ORDER> &allpixels, int nLeds) { + static uint32_t showRGBInternal(MultiPixelController<RGB_ORDER,DLANES, PMASK> &allpixels, int nLeds) { // Get access to the clock ARM_DEMCR |= ARM_DEMCR_TRCENA; ARM_DWT_CTRL |= ARM_DWT_CTRL_CYCCNTENA; diff --git a/platforms/arm/k20/octows2811_controller.h b/platforms/arm/k20/octows2811_controller.h index ed748919..ae508a23 100644 --- a/platforms/arm/k20/octows2811_controller.h +++ b/platforms/arm/k20/octows2811_controller.h @@ -69,7 +69,7 @@ public: virtual void show(const struct CRGB *rgbdata, int nLeds, CRGB scale) { _init(nLeds); - MultiPixelController<8,0xFF,RGB_ORDER> pixels(rgbdata,nLeds, scale, getDither() ); + MultiPixelController<RGB_ORDER,8,0xFF> pixels(rgbdata,nLeds, scale, getDither() ); uint8_t *pData = drawbuffer; while(nLeds--) { diff --git a/platforms/arm/sam/clockless_block_arm_sam.h b/platforms/arm/sam/clockless_block_arm_sam.h index 72b1a0b0..3ffc68c7 100644 --- a/platforms/arm/sam/clockless_block_arm_sam.h +++ b/platforms/arm/sam/clockless_block_arm_sam.h @@ -86,7 +86,7 @@ public: // set all the leds on the controller to a given color virtual void showColor(const struct CRGB & rgbdata, int nLeds, CRGB scale) { - MultiPixelController<LANES,PORT_MASK,RGB_ORDER> pixels(rgbdata,nLeds, scale, getDither() ); + MultiPixelController<RGB_ORDER,LANES,PORT_MASK> pixels(rgbdata,nLeds, scale, getDither() ); mWait.wait(); showRGBInternal(pixels, nLeds); sei(); @@ -97,13 +97,13 @@ public: #define ADV_RGB if(maskbit & PORT_MASK) { rgbdata += nLeds; } maskbit <<= 1; virtual void show(const struct CRGB *rgbdata, int nLeds, CRGB scale) { - MultiPixelController<LANES,PORT_MASK,RGB_ORDER> pixels(rgbdata,nLeds, scale, getDither() ); + MultiPixelController<RGB_ORDER,LANES,PORT_MASK> pixels(rgbdata,nLeds, scale, getDither() ); mWait.wait(); showRGBInternal(pixels, nLeds); mWait.mark(); } - template<int BITS,int PX> __attribute__ ((always_inline)) inline static void writeBits(register uint32_t & next_mark, register Lines & b, Lines & b3, MultiPixelController<LANES, PORT_MASK, RGB_ORDER> &pixels) { // , register uint32_t & b2) { + template<int BITS,int PX> __attribute__ ((always_inline)) inline static void writeBits(register uint32_t & next_mark, register Lines & b, Lines & b3, MultiPixelController<RGB_ORDER,LANES, PORT_MASK> &pixels) { // , register uint32_t & b2) { register Lines b2; transpose8x1(b.bytes,b2.bytes); @@ -141,7 +141,7 @@ public: // This method is made static to force making register Y available to use for data on AVR - if the method is non-static, then // gcc will use register Y for the this pointer. - static uint32_t showRGBInternal(MultiPixelController<LANES, PORT_MASK, RGB_ORDER> &allpixels, int nLeds) { + static uint32_t showRGBInternal(MultiPixelController<RGB_ORDER, LANES, PORT_MASK> &allpixels, int nLeds) { // Serial.println("Entering show"); // Setup the pixel controller and load/scale the first byte Lines b0,b1,b2; |