⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 waveplayer.txt

📁 STM32F103ZET6+UCOSII+UCGUI源码
💻 TXT
📖 第 1 页 / 共 4 页
字号:
;;;73       while(ReadKey() != NOKEY)
000016  bf00              NOP      
                  |L4.24|
000018  f7fffffe          BL       ReadKey
00001c  2800              CMP      r0,#0
00001e  d1fb              BNE      |L4.24|
;;;74       {
;;;75       }  
;;;76     
;;;77       /* Display the welcome screen and the commands */
;;;78       LCD_Update(ALL);
000020  4861              LDR      r0,|L4.424|
000022  f7fffffe          BL       LCD_Update
;;;79     
;;;80       /* Choose number of repetitions: 0 => infinite repetitions */
;;;81       I2S_CODEC_ReplayConfig(0);
000026  2000              MOVS     r0,#0
000028  f7fffffe          BL       I2S_CODEC_ReplayConfig
;;;82       I2S_CODEC_Init(OutputDevice_SPEAKER, AUDIO_FILE_ADDRESS);
00002c  4e5f              LDR      r6,|L4.428|
00002e  2001              MOVS     r0,#1
000030  4631              MOV      r1,r6
000032  f7fffffe          BL       I2S_CODEC_Init
;;;83     
;;;84       /* Endless loop */
;;;85       while(1)
;;;86       {
;;;87         /* Check which key is pressed */
;;;88         MyKey = ReadKey();
;;;89         
;;;90         if(Counter == 0)
;;;91         { /* Mask All Interrupts */
;;;92           NVIC_SETPRIMASK();
;;;93           /* Update the displayed progression information */
;;;94           LCD_Update(PROGRESS);
;;;95           Counter = 0x5FFFF;
;;;96           /* Disable mask of all interrupts */
;;;97           NVIC_RESETPRIMASK();
;;;98         }
;;;99         Counter--;
;;;100        /* If "UP" pushbutton is pressed */
;;;101        if(MyKey == UP)
;;;102        {
;;;103          /* Mask All Interrupts */
;;;104          NVIC_SETPRIMASK();
;;;105          /* Check if the Codec is PLAYING audio file */
;;;106          if (GetVar_AudioPlayStatus() == AudioPlayStatus_PLAYING)
;;;107          {
;;;108            I2S_CODEC_ControlVolume(VolumeDirection_HIGH, VOLStep);
;;;109    
;;;110            /* Update the display information */
;;;111            LCD_Update(VOL);
000036  f44f3780          MOV      r7,#0x10000
;;;112          }
;;;113          /* UP bottomn pushed in PAUSE mode => Enable the Speaker device output ---*/
;;;114          else
;;;115          {
;;;116            /* Update the display information */
;;;117            LCD_Update(PLAY);
;;;118    
;;;119            /* Configure the Speaker as output and reinitialize all devices */
;;;120            err = I2S_CODEC_SpeakerHeadphoneSwap(OutputDevice_SPEAKER, AUDIO_FILE_ADDRESS);
;;;121      
;;;122            /* Error message display if failure */
;;;123            if (err != 0)
;;;124            {
;;;125              LCD_DisplayError(err);
;;;126    
;;;127              /* Enable the FSMC that share a pin w/ I2C1 (LBAR) */
;;;128              RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
00003a  f44f7880          MOV      r8,#0x100
00003e  f04f7980          MOV      r9,#0x1000000         ;117
000042  bf00              NOP                            ;88
                  |L4.68|
000044  f7fffffe          BL       ReadKey
000048  4604              MOV      r4,r0                 ;88
00004a  b945              CBNZ     r5,|L4.94|
00004c  f7fffffe          BL       NVIC_SETPRIMASK
000050  f44f5080          MOV      r0,#0x1000            ;94
000054  f7fffffe          BL       LCD_Update
000058  4d55              LDR      r5,|L4.432|
00005a  f7fffffe          BL       NVIC_RESETPRIMASK
                  |L4.94|
00005e  1e6d              SUBS     r5,r5,#1              ;99
000060  2c04              CMP      r4,#4                 ;101
000062  d11d              BNE      |L4.160|
000064  f7fffffe          BL       NVIC_SETPRIMASK
000068  f7fffffe          BL       GetVar_AudioPlayStatus
00006c  2801              CMP      r0,#1                 ;106
00006e  d102              BNE      |L4.118|
000070  2104              MOVS     r1,#4                 ;108
000072  200f              MOVS     r0,#0xf               ;108
000074  e01e              B        |L4.180|
                  |L4.118|
000076  4648              MOV      r0,r9                 ;117
000078  f7fffffe          BL       LCD_Update
00007c  4631              MOV      r1,r6                 ;120
00007e  2001              MOVS     r0,#1                 ;120
000080  e021              B        |L4.198|
000082  bf00              NOP                            ;125
                  |L4.132|
000084  f7fffffe          BL       LCD_DisplayError
000088  2101              MOVS     r1,#1
00008a  4640              MOV      r0,r8
00008c  f7fffffe          BL       RCC_AHBPeriphClockCmd
;;;129    
;;;130              /* Clear the LCD */
;;;131              LCD_Clear(White);
000090  4650              MOV      r0,r10
000092  f7fffffe          BL       LCD_Clear
;;;132    
;;;133              /* Display the previous menu */
;;;134              DisplayMenu();
000096  f7fffffe          BL       DisplayMenu
;;;135    
;;;136              /* Disable mask of all interrupts */
;;;137              NVIC_RESETPRIMASK();
00009a  f7fffffe          BL       NVIC_RESETPRIMASK
;;;138    
;;;139              /* Enable the JoyStick interrupts */
;;;140              IntExtOnOffConfig(ENABLE); 
;;;141              return; 
00009e  e052              B        |L4.326|
                  |L4.160|
;;;142            }      
;;;143          } 
;;;144          /* Disable mask of all interrupts */
;;;145          NVIC_RESETPRIMASK();
;;;146        }
;;;147    
;;;148        /* If "DOWN" pushbutton is pressed */
;;;149        if(MyKey == DOWN)
0000a0  2c05              CMP      r4,#5
0000a2  d115              BNE      |L4.208|
;;;150        {
;;;151          /* Mask All Interrupts */
;;;152          NVIC_SETPRIMASK();
0000a4  f7fffffe          BL       NVIC_SETPRIMASK
;;;153    
;;;154          /* If the Codec is PLAYING => Decrease Volume*/
;;;155          if (GetVar_AudioPlayStatus() == AudioPlayStatus_PLAYING)
0000a8  f7fffffe          BL       GetVar_AudioPlayStatus
0000ac  2801              CMP      r0,#1
0000ae  d105              BNE      |L4.188|
;;;156          {
;;;157            /* Increase the audio codec digital volume */
;;;158            I2S_CODEC_ControlVolume(VolumeDirection_LOW, VOLStep);
0000b0  2104              MOVS     r1,#4
0000b2  200a              MOVS     r0,#0xa
                  |L4.180|
0000b4  f7fffffe          BL       I2S_CODEC_ControlVolume
;;;159    
;;;160            /* Update the LCD display */ 
;;;161            LCD_Update(VOL); 
0000b8  4638              MOV      r0,r7
0000ba  e015              B        |L4.232|
                  |L4.188|
;;;162          }
;;;163          else /* If the Codec is PAUSED => Headphone Enable */
;;;164          {
;;;165            /* Update the LCD display */ 
;;;166            LCD_Update(PLAY);
0000bc  4648              MOV      r0,r9
0000be  f7fffffe          BL       LCD_Update
;;;167          
;;;168            /* Enable the Headphone output and reinitialize all devices */ 
;;;169            err = I2S_CODEC_SpeakerHeadphoneSwap(OutputDevice_HEADPHONE, AUDIO_FILE_ADDRESS);
0000c2  4631              MOV      r1,r6
0000c4  2002              MOVS     r0,#2
                  |L4.198|
0000c6  f7fffffe          BL       I2S_CODEC_SpeakerHeadphoneSwap
0000ca  2800              CMP      r0,#0
                  |L4.204|
0000cc  d1da              BNE      |L4.132|
0000ce  e01b              B        |L4.264|
                  |L4.208|
;;;170    
;;;171            /* Error message display if failure */
;;;172            if (err != 0)
;;;173            {
;;;174              LCD_DisplayError(err);
;;;175    
;;;176              /* Enable the FSMC that share a pin w/ I2C1 (LBAR) */
;;;177              RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
;;;178    
;;;179              /* Clear the LCD */
;;;180              LCD_Clear(White);
;;;181    
;;;182              /* Display the previous menu */
;;;183              DisplayMenu();
;;;184    
;;;185              /* Disable mask of all interrupts */
;;;186              NVIC_RESETPRIMASK();
;;;187    
;;;188              /* Enable the JoyStick interrupts */
;;;189              IntExtOnOffConfig(ENABLE); 
;;;190              return; 
;;;191            }  
;;;192          }
;;;193          /* Disable mask of all interrupts */
;;;194          NVIC_RESETPRIMASK();
;;;195        }
;;;196    
;;;197        /* If "RIGHT" pushbutton is pressed */
;;;198        if(MyKey == RIGHT)
0000d0  2c02              CMP      r4,#2
0000d2  d10c              BNE      |L4.238|
;;;199        {
;;;200          /* Mask All Interrupts */
;;;201          NVIC_SETPRIMASK();
0000d4  f7fffffe          BL       NVIC_SETPRIMASK
;;;202    
;;;203          /* Check if the Codec is PLAYING audio file */
;;;204          if (GetVar_AudioPlayStatus() == AudioPlayStatus_PLAYING)
0000d8  f7fffffe          BL       GetVar_AudioPlayStatus
0000dc  2801              CMP      r0,#1
0000de  d113              BNE      |L4.264|
;;;205          {
;;;206            I2S_CODEC_ForwardPlay(STEP_FORWARD); 
0000e0  2002              MOVS     r0,#2
0000e2  f7fffffe          BL       I2S_CODEC_ForwardPlay
;;;207            /* Update the display information */
;;;208            LCD_Update(FRWD); 
0000e6  e00d              B        |L4.260|
                  |L4.232|
0000e8  f7fffffe          BL       LCD_Update
0000ec  e00c              B        |L4.264|
                  |L4.238|
;;;209          }
;;;210          /* Disable mask of all interrupts */
;;;211          NVIC_RESETPRIMASK(); 
;;;212        }
;;;213        /* If "LEFT" pushbutton is pressed */
;;;214        if(MyKey == LEFT)
0000ee  2c03              CMP      r4,#3
0000f0  d10d              BNE      |L4.270|
;;;215        {
;;;216          /* Mask All Interrupts */
;;;217          NVIC_SETPRIMASK();
0000f2  f7fffffe          BL       NVIC_SETPRIMASK
;;;218    
;;;219          /* Check if the Codec is PLAYING audio file */
;;;220          if (GetVar_AudioPlayStatus() == AudioPlayStatus_PLAYING)
0000f6  f7fffffe          BL       GetVar_AudioPlayStatus
0000fa  2801              CMP      r0,#1
0000fc  d104              BNE      |L4.264|
;;;221          {
;;;222            I2S_CODEC_RewindPlay(STEP_BACK);
0000fe  2006              MOVS     r0,#6
000100  f7fffffe          BL       I2S_CODEC_RewindPlay
                  |L4.260|
;;;223            /* Update the display information */
;;;224            LCD_Update(FRWD);  
000104  4640              MOV      r0,r8
000106  e7ef              B        |L4.232|
                  |L4.264|
;;;225          } 
;;;226          /* Disable mask of all interrupts */
;;;227          NVIC_RESETPRIMASK();
000108  f7fffffe          BL       NVIC_RESETPRIMASK
                  |L4.268|
00010c  e79a              B        |L4.68|
                  |L4.270|
;;;228        }
;;;229    
;;;230        /* If "SEL" pushbutton is pressed */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -