Example #1
0
void main()
	{
	InitVoice();
	
	// lock the external motor, prohibit motor moving when power up.
	InitElecmotor();	
	
	InitUART(BAUD9600);

//	#ifdef WX
//	InitUART(BAUD1200);
//	#endif
	
	InitSensor();
	
	InitTransceiver();
	
  
	Externalmotor = Close;

	Flash_Page_Erase(0x3000);

	Flash_Write_Data(0x3000, 0x00);		
	Flash_Write_Data(0x3001, 0x25);		
	Flash_Write_Data(0x3002, 0x12);		
	Flash_Write_Data(0x3003, 0xf7);		
	Flash_Write_Data(0x3004, 0x85);
	transmiter_EN = 1;
	
	while(1)
		{		
		}
	}
Example #2
0
void main(void)
	{
	InitVoice();

	InitUART(BAUD1200);

	#ifdef F2
	InitUART(BAUD9600);
	#endif

	// �����жϳ�ʼ��
	press_open_button = 1;
	press_close_button = 1;
	
	#ifdef WX
	KBLS1 |= 0x03;
	KBLS0 |= 0x03;
	KBIF &= 0xfc;
	KBIE |= 0x03;
	EKB = 1;
	#endif

	EA = 1;

//	Moto_EN = 1;		//��ʼ�����ر����
	voice_EN = 0;		  	//����ʱ�������Źر�
	P10 = 1;
	
//	ADC_check_result = 0x3ff;
	
	stolen_alarm_count = 0;			//�屨��������
	stolen_alarm_flag = 0;			//�屨����־

//	transmit_wire = 0;
	transmiter_EN = 0;		// turn off the transmitter
	receiver_EN = 0;			// turn on the receiver
	transceiver_power_enable = 0;         // �ϵ�ʱ����ģ���Դ�ر�


	while(1)
		{
		#ifdef Z2
		if(idle_EN == 1)
			{
			idle_EN = 0;
			PCON |= 0x02;			
			}
		#endif
			
		
		sEOS_Go_To_Sleep();			
		}
	}
Example #3
0
void main() {
    ALport alp;
    FileDescriptor dacfd, sockfd;	
    int udp_port = 7000;
    SynthState voices[2];


    InitVoice(voices, 440);
    InitVoice(voices+1, 220);

    dacfd = InitAudio(&alp);
    sockfd = initudp(udp_port);
    if(sockfd<0) {
	perror("initudp");
	return;
    }

    InitPriority();

    InitOSC(voices, voices+1);

    MainLoop(alp, dacfd, sockfd, voices, voices+1);
}