/*----------------------------------------------------------------------------*/ void break_encode(void) { #if defined(INDEPENDENT_REC_LED) flashled(LED_ON); rec_flash_led(LED_OFF); #endif switch (encode_status) { case RECODE_STOP: break; case RECODE_PLAY: if(REC_MIC_MODE != work_mode) { break; } encode_status = RECODE_STOP; break; case RECODE_INIT: if(REC_MIC_MODE == work_mode) { break; } encode_status = RECODE_STOP; break; case RECODE_WORKING: case RECODE_PAUSE: api_stop_encode(); break; default : break; } }
void api_stop_encode(void) { #ifdef REC_GPIO_CTRL REC_GPIO_LOW(); #endif #if defined(INDEPENDENT_REC_LED) rec_flash_led(LED_OFF); #else flashled(LED_ON); #endif stop_encode(); encode_status = RECODE_STOP; }
/*#************************************************************************** *# *# FUNCTION NAME: startc *# *# PARAMETERS : None *# *# RETURNS : Nothing *# *# SIDE EFFECTS : *# *# DESCRIPTION : Is called from the startup assembler file of the *# box, after initialization of registers, stack pointers etc. *# *# *#**************************************************************************/ void startc(void) { flashled(); print("\r\n\r\nHello world.\r\n"); /* Now after we've shown that we're alive, we can let in interrupts. */ __asm__ ("ei"); while(1) { } } /* startc */
scofunc login() { static int x; static char name[16],pass[16],buffer[80]; name[0]=pass[0]=0; glBlankScreen(); wfd { //clrscr(); putat(0,0,"name:"); putat(0,1,"password:"******"name %s\npassword %s\n\n ACCEPTED", name,pass); wfd putat(0,0,buffer); flashled(1); //green led waitfor(DelaySec(3)); } else { flashled(0); //red led abort; } }
/*#************************************************************************** *# *# FUNCTION NAME: startc *# *# PARAMETERS : None *# *# RETURNS : Nothing *# *# SIDE EFFECTS : *# *# DESCRIPTION : Is called from the startup assembler file of the *# box, after initialization of registers, stack pointers etc. *# Performs a copy of data from PROM into RAM, then starts *# the OS. *# *#--------------------------------------------------------------------------- *# HISTORY *# *# DATE NAME CHANGES *# ---- ---- ------- *# Jun 12 1995 Jens Johansson Added 530 fix. After the analog ethernet *# circuit was replaced with the same circuit *# as in the 550r, the reset signal was NOT *# taken from the same pin (P15), but from TXD2 *# instead. It is set to low here. *# Jun 20 1995 Jens Johansson Hardware is the same now. The above fix *# removed. *# Nov 30 1995 Sven Ekstrom Added unconditional printout of product *# name, version, and creation information. *# *#**************************************************************************/ void startc(void) { flashled(); ax_printf("\r\n\r\nServer boot.\r\n"); ax_printf("heapbase %08x heaptop %08x heapsize %08x\n", __heapbase,__heaptop,__heaptop - __heapbase); aheap_init(__heapbase, __heaptop - __heapbase); /* Now after we've shown that we're alive, we can let in interrupts. */ __asm__ ("ei"); __do_global_ctors(); ax_printf("\n\nStarting OSYS.\n"); os_start(); // will never return here! } /* startc */
/*----------------------------------------------------------------------------*/ void aux_fun(void) { flashled(3); // amp_abd(1); //work_mode++; //return ; input_number_en = 0; vol_change_en=1; main_menu = MENU_AUX; disp_port(MENU_AUX); amux_dsp_eq(); SYSTEM_CLK_DIV4(); encode_channel = REC_LINEIN; encode_vol = 3; key_table_sel(0); flush_all_msg(); set_max_vol(MAX_ANOLOG_VOL,MAX_DIGITAL_VOL);///设置最大音量 aux_main(); main_vol_set(0, CHANGE_VOL_NO_MEM); break_encode(); }
void main(void) { tcp_Socket tcpSock; char *messages[12]; unsigned int key; int i, send_response, test; // Initialize flag to indicate not ready to send response send_response = FALSE; // Initialize the message array with NULL pointers for (i = 0; i < (sizeof(messages)/sizeof(char*)); i++) { messages[i] = NULL; } // Define messages here--note that you only need define the messages // you will actually use. messages[0] = "I hear ya..."; messages[1] = "Hello, there..."; messages[2] = "It's a \"Rabbit\" Kind of place..."; initsystem(); sock_init(); // Configure the upper row of keys on the keypad, in order // from left to right. for (i = 0; i < 7; i++) { // Only enable a key if there is a corresponding message if (messages[i] != NULL) { keyConfig ( i, ('0'+ i), 0, 0, 0, 0, 0 ); } else { keyConfig ( i, IGNORE, 0, 0, 0, 0, 0 ); } } while (1) { // Process Keypad Press/Hold/Release costate { keyProcess (); waitfor ( DelayMs(10) ); } costate { // Wait for a message from another device if (send_response == FALSE) { glBlankScreen(); TextGotoXY(&wholewindow, 0, 0 ); TextPrintf(&wholewindow, "Waiting for a \nmessage to be sent!"); // Function is blocking until a message is received RecvMessage(&tcpSock); // Received message, prompt user to continue TextGotoXY(&wholewindow, 0, 3 ); TextPrintf(&wholewindow, "Press key to proceed"); // Allow the keyProcess function(above costate) to execute before // checking for keypress. waitfor(DelayMs(10)); // Check if a key has been pressed waitfor ( key = keyGet() ); // Wait for Keypress // Set flag to send respond back to controller that // sent the message. send_response = TRUE; } } costate { if(send_response) { glBlankScreen(); TextGotoXY(&wholewindow, 0, 0 ); TextPrintf(&wholewindow, "Press the key that \nis setup to send \nyour response..."); waitfor ( key = keyGet() ); // Wait for Keypress // Flash Leds to indicate that a key has been pressed flashled(key - '0'); // Only handle the keypress if it corresponds to a message and if // a response is currently needed if (key != IGNORE) { SendMessage(&tcpSock, (key - '0'), messages); send_response = FALSE; } } } } }
void main(void) { amp_mute(1); clock_in = T0CNT; //输入时钟,define in clock.h // WDT_EN(); sys_init(); //power_key_hdlr(SYS_PWR_ON); flashled(LED_ON); AMUX_P2IE_SET(AMUX0_IE&AMUX1_IE); sys_info_init(); clear_all_event(); flush_all_msg(); //work_mode=REC_MIC_MODE; ///* while (1) { switch (work_mode) { case MUSIC_MODE: music_decode(); break; #if USB_DEVICE_ENABLE case USB_DEVICE_MODE: usb_audio_massstorage(); break; #endif #if FM_MODULE case FM_RADIO_MODE: fm_radio(); break; #endif #ifndef NOT_USE_LINE_IN_FUNC case AUX_MODE: aux_fun(); break; #endif #if RTC_ENABLE case RTC_MODE: rtc_fun(); break; #endif case REC_MIC_MODE: rec_mic_fun(); break; case IDLE_MODE: #ifndef NO_IDLE_MODE_FUNC idle_mode(); #endif // power_key_hdlr(SYS_PWR_OFF); break; default: work_mode = MUSIC_MODE; break; } write_info(MEM_SYSMODE ,work_mode); } //*/ }