Page 173 - MDP2022-2
P. 173

#endif


                        for  (int  i  =  23;  i  >=  0;  i--)  {
                              if  (color  &  (1  <<  i))  {
                                    pwmData[indx]  =  60;    //  2/3  of  90
                              }


                              else
                                    pwmData[indx]  =  30;    //  1/3  of  90


                              indx++;
                        }


                  }


                  for  (int  i  =  0;  i  <  50;  i++)  {
                        pwmData[indx]  =  0;
                        indx++;
                  }


                  HAL_TIM_PWM_Start_DMA(&htim1,  TIM_CHANNEL_1,  (uint32_t*)  pwmData,  indx);
                  while  (!datasentflag)  {
                  };
                  datasentflag  =  0;
            }


            void  WS2812_Send2(void)  {
                  uint32_t  indx  =  0;
                  uint32_t  color;


                  for  (int  i  =  0;  i  <  MAX_LED2;  i++)  {
            #if  USE_BRIGHTNESS
                        color  =  ((LED_Mod2[i][1]  <<  16)  |  (LED_Mod2[i][2]  <<  8)  |  (LED_Mod2[i][3]));
            #else
                        color  =  ((LED_Data2[i][1]  <<  16)  |  (LED_Data2[i][2]  <<  8)  |  (LED_Data2[i][3]));
            #endif


                        for  (int  i  =  23;  i  >=  0;  i--)  {
                              if  (color  &  (1  <<  i))  {
                                    pwmData2[indx]  =  60;    //  2/3  of  90
                              }


                              else
                                    pwmData2[indx]  =  30;    //  1/3  of  90
   168   169   170   171   172   173   174   175   176   177   178