Esempio n. 1
0
//LED1闪烁任务----------------------------------------
static  void Task_Led1(void* p_arg)
{
   


   (void) p_arg;	    
   while (1)
   {
      LED_LED1_ON();
      OSTimeDlyHMSM(0, 0, 0, milsec1);
      
      LED_LED1_OFF();
      OSTimeDlyHMSM(0, 0, 0, milsec1);	
   }
}
Esempio n. 2
0
void USART1_IRQHandler(void) // Interrupt on char recieving from USART1 (Android board)
{
	unsigned char param[16];
	LED_LED1_ON();
	if (USART_GetITStatus(USART1, USART_IT_RXNE) != (u16)RESET)
				{
					USART_ClearITPendingBit(USART1, USART_IT_RXNE);
					AndroidReceivedChar = USART_ReceiveData(USART1);
					AndroidBuffer[AndroidBufferIndex] = AndroidReceivedChar;
					AndroidBufferIndex++;
					if (AndroidReceivedChar == 19) // f*****g programmer
					{
						AndroidBuffer[AndroidBufferIndex-1] = 0; //EOL
						AndroidBufferIndex = 0;

						strcpy(param, AndroidBuffer+1);

						switch (AndroidBuffer[0]) {
								case 'R':
									if (!strcmp(param, "0")) {
										GUI_DispString("Radio Mute\n");
									// TODO: Radio mute
										break;
									}
									GUI_DispString("Freq = "); GUI_DispDec(atol(param)*100000, 9); GUI_DispString("Hz\n");
									SetPLL(atol(param)*100000);
									break;
								case 'V':
									setAudioVolume(atoi(param));
									GUI_DispString("Volume = "); GUI_DispDec(atoi(param), 2); GUI_DispString("\n");
									break;
								case 'B':
									setAudioBalance(atoi(param));
									GUI_DispString("Balance = "); GUI_DispDec(atoi(param), 2); GUI_DispString("\n");
									break;
								case 'J':
									setAudioBass(atoi(param));
									GUI_DispString("Bass = "); GUI_DispDec(atoi(param), 2); GUI_DispString("\n");
									break;
								case 'K':
									setAudioTreble(atoi(param));
									GUI_DispString("Treble = "); GUI_DispDec(atoi(param), 2); GUI_DispString("\n");
									break;
								case 'L':
									setAudioRearLeftVolume(atoi(param));
									GUI_DispString("Rear Left volume = "); GUI_DispDec(atoi(param), 2); GUI_DispString("\n");
									break;
								case 'X':
									setAudioRearRightVolume(atoi(param));
									GUI_DispString("Rear Right volume = "); GUI_DispDec(atoi(param), 2); GUI_DispString("\n");
									break;
								case 'M':
									setAudioMute(atoi(param));
									GUI_DispString("Audio mute = "); GUI_DispDec(atoi(param), 2); GUI_DispString("\n");
									break;
								case 'S':
									setAudioSource(atoi(param));
									GUI_DispString("Audio source = "); GUI_DispDec(atoi(param), 2); GUI_DispString("\n");
									break;
								default:
									break;
						}
					}
				}
				LED_LED1_OFF();
}