亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? player.c

?? MP3 Player Source Code
?? C
?? 第 1 頁 / 共 2 頁
字號:
/**\file player.c * VLSI Modular Player Main file * * * This file contains the main() function. * It's also the main playground for player UI development. * Many functions will be transferred to a new module when they're ok. *//** \mainpage *  * This is a preliminary version of the new MP3 player  * evaluation kit source code. Some bugs still exist. *  * This is pure C code. No inline assembly. * It compiles with SDCC 2.4.0. Upload with Atmel Flip. * Connect a terminal with settings 115200bps,N81 to the * serial port to see the console output. * * The code is written for VLSI Evakit 1.5-1.6 that has VS1011/1002 * and AT89C51RD2 microcontroller.  * Now also Evakit 2.0-2.5 with VS1011, VS1002 or VS1003 is supported.  * It should be easily portable * for other microcontrollers.  * * All microcontroller/pcb -specific definitions should * be in board.h and board.c but some board specific * features may still lurk in the code elsewhere.  * Due to SDCC requirements, interrupts are defined in player.c (main file). * They are of course board/cpu dependent. * * Throughout the code, SDCC memory allocation pragmas "code" "data" and "xdata" * are used, sorry. "Code" allocates from ROM, "data" allocates from fast RAM, * "xdata" allocates from slow RAM. You may need to remove/adjust these to make * code compatible with your compiler. * * It is strongly suggested that you use the free SDCC 2.4.0 to compile the * code. SDCC 2.5.0 fails to compile the code: Although it has advantages * over v2.4, it tries to allocate more extra temporary memory than is * available if you compile all the modules (incl. recording). * * <B>How to get started</b> * * - Look at "File list" to see what kind of modules are in the project. * - Look at vs10xx.c and vs10xx.h file documentations to see how the * vs10xx is reset and how to send MP3 data to it (PlayDiskSectors()). * - Function AvailableProcessorTime() handles the user interface. It is * called by PlayDiskSectors() whenever the player seems to have some free * time. Additionally, a timer interrupt routine sets the  * <b>userInterfaceDelayElapsed</b> flag every 50ms or so. To avoid unnecessary * CPU load, AvailableProcessorTime() * checks this flag and updates display etc only when this flag is set. * - The user interface commands the player routine by setting a special * state variable <b>playingState</b>. For instance if the user pushes a "Next Song" * button, the ui should set <b>playingState</b> to <i>PS_NEXT_SONG</i>.  * PlayDiskSectors() detects this, stops playing and returns to caller. * - Much of the main functionality is still in player.c and main(). Much * of it will be transferred to a new file ui.c at some time. * * The description of how the program works and the module structure will be * written here soon. Please check http://www.vlsi.fi/ * often to see if the final code is released. Email to * mp3@vlsi.fi about bugs. * * <b>Changes in version 0.5:</b> * * Filesystem and Storage are affected. Code has been added to handle new * MMC cards with manufacturer id 21 and possibly others that seem to * (sometimes) require resetting CRC calculation before they agree to work. * Storage.c is divided into submodules storage.c and mmc.c and a new  * file buffer.c is created to hold the global I/O buffer. This clarifies * the code a lot. Lots of documentation is added to MMC and filing system * functions, do yourself a favor and read it through. * * In storage.c, mmc.c and filesys.c a "dummy" declarator Public is added * in declarations for functions that are called from outside the module * and thus form module interface. It has no code effect in C but is a * reminder for the programmer that the functions need to be adjusted * carefully. * * Storage.c is now a "middle-level" disk handler that takes advantage of * lower level functions in mmc.c. It handles decisions of when to seek * based on testing whether the underlying storage module supports  * separate seeks before reads. A new function PrepareToReadDiskSector() is * for telling the storage that it can do a seek now if the storage * supports it. * * Adding support for different storage media that MMC is easy: only mmc.c * needs to be rewritten. Currently it only has 3 public functions: * Init, Seek sector and Read sector. As the code uses ONLY the address * granularity of 512 bytes, called a "disk sector", supporting hard * disks etc should be very simple. * * * <b>Support for compiling under Windows:</b> * * The code is natively developed under Linux and Makefile for GNU Make is * included. Now also .bat files for compiling in Dos window under Win32 * are included, plus a readme.txt file. Use them at your own risk :) * * <B>Changes in version 0.6</b> * * The major improvement is adding recording support. Recording for  * VS1003 is supported. See the Record() function documentation for  * instructions. The Record() function can only create a single file * fragment. If a fragment boundary is reached, recording continues * to a new file. * Also there is an experimental function PlayAVI() in * module aviplay.c that often succeeds in demuxing an avifile and * sending just the audio stream for decoding. * * Much of the FAT code is rewritten for speedups. * * \todo VFAT long file names, *  * \remarks If you are usind SDCC 2.4.0 and you need just a little bit * of more DSEG memory (now how on Earth that might happen...) you * can hand-allocate global variables to unused addresses 0x08..0x1F, * for instance: declaring * <pre> * data at 0x08 unsigned int myVariable; * </pre> * would place myVariable in DSEG addresses 0x08..0x09. * * Note for HyperTerminal users: Check the "Append Line Feeds" checkbox  * in terminal settings -> ascii setup. * * Example output to console: When the code runs it prints out something like: * (from a little older version) * <pre> * * Board: Console is up. * Init: Board; supports: AT89C51RD2, MMC, VS10xx, RS232 *  * VLSI Modular Player * Starting up. *  * Init: Filesystem; supports: MBR, FAT16, FAT32 * Trying to bring up storage... * Init: Storage v2: supports: MMC,SD,miniSD in SPI mode * Init: MMC * Card found, starting... Ok. *  * MMC Manufacturer#: 30 Product Name: MMC    Production date: 10 / 2004 * Media serial number: 00000468 * This MMC has no support for interrupted read. Using compatibility mode. * Storage initialized in seek-and-read mode. * Storage ok. * Sector 0 read...ok. * Sector signature...ok. * Partition 1... at sector 00000020 * Formatter signature: %j!BFIHC * Bytes per sector:    512 * Bytes per sector:    512 * Reserved sectors:    1 * Number of FATs:      2 * Root entries:        512 * Total Sectors 16:    0 * Fat Size 16:         123 * Hidden Sectors:      32 * Total Sectors 32:    125408 * File system is FAT16 * File system signature is FAT16 * Volume Label is NO NAME * Sectors per Cluster: 4 * FAT Start sector:    33 * Root start sector:   279 * Data start sector:   303 *  * Init: VS10XX * Loading patch. *  * Filesystem: Looking for file 1 ... found, FAT name is "UTOPIA~1MP3" * File size: 1471792 bytes. Start cluster: 0003h, sector 315 decimal. * Building file fragment table... * Fragment Start: 315  Fragment End: 3190  Fragment length: 2876 *  * Fragments: 1 * Player: Playing from sector 315 * * </pre> * ...and so on. * */#include "board.h"#include "lcd.h"#include "filesys.h"#include "vs10xx.h"#include "storage.h"#include "display.h"#include "string.h"#include "ui.h"#include "mmc.h"#include "record.h"/**  typedef for loading patch code */#define u_int8 code unsigned char /**  typedef for loading patch code */#define u_int16 code unsigned int //include a patch code module#ifdef VS1003#include "spec_rew.c"#else#include "loud_sa.c"#endif/** How much to wait for button pressed before returning to title */#define UI_RETURN_DELAY 150/** Playing State Global */xdata playingstatetype playingState = PS_NORMAL;/** Current interrupt level */unsigned char intlevel = 0;/** Interrupt-driven flag to reduce unnecessary UI updates. * This is set to 1 by timer interrupt every n milliseconds. */xdata unsigned char userInterfaceDelayElapsed = 0;/** Current User Interface mode (Title, Volume, ...) */xdata uimodetype uiMode = UI_SPEC;xdata unsigned char SPMax=0;/** User Interface Timer interrupt. * Does NOT do any screen/button handling, only updates * screen scroll variable and the  * userInterfaceDelayElapsed flag. */void timer0_interrupt(void) interrupt 1{  static char displayDelay;  userInterfaceDelayElapsed = 1;  if (++displayDelay==12){    displayDelay = 0;    displayPosition++;    if (displayPosition>displayLength+7){      displayPosition = -7;    }  }  if (SP>SPMax) SPMax = SP;  }/** Load a patch code to VS10xx */void LoadPatch(){  ConsoleWrite ("Loading patch.\r");  for (temp.i=0; temp.i < CODELEN; temp.i++) {        Mp3WriteRegister(atab[temp.i], dtab[temp.i]>>8, dtab[temp.i]&0xff);   }  Delay(10);}/** Start patch code */void StartPatch(){#ifdef VS1003  //  Mp3WriteRegister(SPI_AIADDR, 0x00, 0x50);            #else  //Mp3WriteRegister(SPI_AIADDR, 0x02, 0x00);              //Mp3WriteRegister(SPI_AICTRL0, 0x00, 0x00);  //Mp3WriteRegister(SPI_AICTRL0, 0x00, 0x01);#endif}/** Sets playing time and mode icon to left display title */void ScreenSetPlayTime(){  unsigned int playTime;  unsigned char minutes, seconds;  playTime = Mp3ReadRegister(SPI_DECODE_TIME);  minutes = playTime/60;  seconds = playTime%60;  displayTitle[0]=('0'+minutes/10);  displayTitle[1]=('0'+minutes%10);  displayTitle[2]=(':');  displayTitle[3]=('0'+seconds/10);  displayTitle[4]=('0'+seconds%10);  displayTitle[5]=(' ');  displayTitle[6]=(' ');  displayTitle[7]=(' ');    if (seconds&1){    if (playingState == PS_RECORDING){      displayTitle[6]='o';    }else{      displayTitle[6]='\x7e';    }  }  if ((playingState != PS_NORMAL)&&(playingState != PS_RECORDING)){    displayTitle[6]='\xdb';  }    }/** This function is called when the player is playing a song and there is free processor time. The basic task of this function is to implement the player user interface. */void AvailableProcessorTime(){  /** Local variables: */  /** - <b>volume</b>: Current volume setting */  static xdata unsigned char volume = 20;  /** - <b>bass</b>: Current bass enhancer setting */  static xdata unsigned char bass = 0;  /** - <b>treble</b>: Current treble enhancer setting */  static xdata unsigned char treble = 64; //middle setting = 0  /** - <b>reclevel</b>: Current recording level setting */  static xdata unsigned char reclevel = 50;  unsigned int i; //temp variable  static bit bassUpdateNeeded;  /** - <b>uiReturnDelay</b>: Counts down to returning to UI mode      0 (title screen) */  static unsigned char uiReturnDelay=0;  if (!userInterfaceDelayElapsed){    return; /* Not yet time to do user interface stuff */  }    userInterfaceDelayElapsed = 0;  // User Interface Modes  // Return to UI_TITLE after long period of button inactivity  if (uiReturnDelay == 0){    if ((uiMode != UI_SPEC)&&(uiMode != UI_CUE))      uiMode = UI_TITLE;    else{    }  }else{    uiReturnDelay--;  }  #ifndef VS1003  if (uiMode==UI_SPEC) //Only VS1003 has spectrum analyzer    uiMode++;  if (uiMode==UI_RECLEVEL) //Only record in VS1003 chips    uiMode++;#endif  if (uiMode==UI_INFO)    uiMode++; //Nothing interesting currently in screen UI_INFO.  if (uiMode==UI_STOP)    uiMode++; //Nothing interesting currently in screen UI_STOP.  /* Screen updates */  switch(uiMode){      case UI_TITLE:  //Playing time, song title    displayStyle = DS_TEXT;    ScreenSetPlayTime();        if (playingState==PS_RECORDING){            displayStyle = DS_PERCENTAGE;    }             break;      case UI_STOP: //Ask if the user wants to stop    displayStyle = DS_NO_YES;    strcpy (displayTitle, "Stop?   ");    break;  case UI_CUE: //Ask if the user wants to fast forward or rewind    displayStyle = DS_RAWTEXT;    strcpy (displayTitle, "REW/CUE  <-   ->");    //i = Mp3ReadRegister(SPI_HDAT1);    //displayTitle[5] = lcd_hexchars[i>>12];    //displayTitle[6] = lcd_hexchars[(i>>8)&0x0f];    //displayTitle[7] = lcd_hexchars[(i>>4)&0x0f];    //displayTitle[8] = lcd_hexchars[i&0x0f];    break;      case UI_VOLUME: //Show volume bar    LcdSelectFont(lcdFont_barchars);    displayStyle = DS_PERCENTAGE;    strcpy(displayTitle,"Volume: ");    displayValue = (100-(volume>>1));    if (displayValue<0) displayValue = 0;    break;  case UI_BASS: //Show bass bar    LcdSelectFont(lcdFont_barchars);    displayStyle = DS_PERCENTAGE;    strcpy(displayTitle,"Bass:   ");    displayValue = (bass/5)*4;    if (displayValue<1) displayValue = 1;    break;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合天天综合网国产成人综合天| 亚洲男人的天堂在线aⅴ视频| 捆绑变态av一区二区三区 | 国产乱人伦偷精品视频免下载| 日韩欧美国产麻豆| 国产乱人伦偷精品视频免下载| 欧美国产精品专区| 99久久精品免费看国产免费软件| 亚洲免费在线观看| 日韩欧美一级精品久久| 国产乱人伦偷精品视频不卡| 亚洲欧美日韩国产另类专区| 欧美日韩成人综合在线一区二区| 日本欧美韩国一区三区| 日本一区二区三区四区在线视频| 97aⅴ精品视频一二三区| 午夜视频一区二区三区| 国产亚洲综合在线| 在线免费观看一区| 久久99久久99小草精品免视看| 国产女人18水真多18精品一级做| 色av综合在线| 国产在线不卡一区| 亚洲午夜久久久久中文字幕久| 精品国产精品网麻豆系列| 99久久精品免费观看| 日韩中文字幕不卡| 国产精品区一区二区三| 欧美日本在线一区| 成人av综合一区| 久久国产生活片100| 一区二区在线观看av| 精品三级在线观看| 欧美在线观看视频一区二区 | 国产精品亚洲一区二区三区在线| 亚洲码国产岛国毛片在线| 日韩美女天天操| 在线视频你懂得一区| 国产精品99久久久| 日韩国产一二三区| 一区二区三区自拍| 国产精品少妇自拍| 91行情网站电视在线观看高清版| 国产精品久久久久aaaa樱花| 99久久久精品免费观看国产蜜| 欧美电影免费观看高清完整版在 | 国产精品久久久久影院老司| 日韩一区二区麻豆国产| 日本久久一区二区| 国产99久久久国产精品潘金| 久久99九九99精品| 日本午夜一本久久久综合| 一区二区三区成人在线视频| 久久久99精品免费观看不卡| 日韩精品在线一区| 欧美乱妇20p| 欧美自拍偷拍午夜视频| 91亚洲国产成人精品一区二区三 | 激情小说欧美图片| 视频一区视频二区中文字幕| 亚洲精品免费看| 亚洲日本va午夜在线影院| 中文字幕 久热精品 视频在线| 亚洲精品在线免费观看视频| 日韩一区二区影院| 欧美一级片在线| 日韩西西人体444www| 日韩区在线观看| 日韩你懂的在线观看| 欧美大肚乱孕交hd孕妇| 欧美一区二区三区精品| 日韩一区二区三区在线观看| 欧美一区日本一区韩国一区| 这里只有精品免费| 欧美一区二区播放| 日韩区在线观看| 久久亚洲精品小早川怜子| 久久久99免费| 国产精品午夜久久| 中文字幕一区二区在线观看| 亚洲特级片在线| 一区二区三区毛片| 天涯成人国产亚洲精品一区av| 视频在线在亚洲| 精品一区二区三区免费播放| 国产一区二区三区| 东方aⅴ免费观看久久av| 成人午夜av电影| 91天堂素人约啪| 欧美日韩一区二区三区高清| 欧美猛男男办公室激情| 欧美不卡一区二区| 中国av一区二区三区| 亚洲激情自拍偷拍| 免费日韩伦理电影| 成人午夜视频在线| 91官网在线免费观看| 欧美男人的天堂一二区| 亚洲精品一区二区三区福利| 久久精品亚洲精品国产欧美| 亚洲欧美综合网| 五月开心婷婷久久| 国产真实乱对白精彩久久| 91丨九色丨黑人外教| 欧美精品免费视频| 国产清纯在线一区二区www| 亚洲欧洲精品一区二区精品久久久| 一区二区三区在线免费| 免费人成在线不卡| 国产mv日韩mv欧美| 欧美日韩三级在线| 久久久精品免费免费| 亚洲综合成人网| 国产中文字幕精品| 欧美亚洲综合在线| 久久久久久久久蜜桃| 亚洲一区二区在线视频| 国精品**一区二区三区在线蜜桃| 91在线观看污| 日韩一区二区三区av| 亚洲视频一区二区在线| 黄色日韩网站视频| 欧美日韩中文国产| 中国av一区二区三区| 麻豆国产91在线播放| 在线视频你懂得一区| 国产欧美日韩另类视频免费观看| 亚洲成人动漫av| 99久久综合色| 久久综合av免费| 日本美女一区二区| 一本一道波多野结衣一区二区| 欧美精品一区二区久久久| 亚洲国产精品一区二区尤物区| 国产很黄免费观看久久| 日韩欧美一二区| 亚洲成人第一页| 色94色欧美sute亚洲线路一ni| 久久精品一区四区| 久热成人在线视频| 91精品国产91热久久久做人人| 一区二区三区视频在线观看| 国产成人精品www牛牛影视| 日韩亚洲欧美综合| 日日摸夜夜添夜夜添国产精品| 一本色道久久加勒比精品| 国产精品卡一卡二卡三| 狠狠色丁香久久婷婷综合_中| 欧美精选午夜久久久乱码6080| 亚洲品质自拍视频网站| 风间由美一区二区av101| 精品国产sm最大网站| 青青草国产成人99久久| 在线综合视频播放| 午夜精品久久久久影视| 欧美日韩国产小视频| 亚洲国产日韩综合久久精品| 在线免费观看视频一区| 亚洲一区视频在线| 欧美影院精品一区| 亚洲电影你懂得| 欧美电影一区二区三区| 婷婷开心激情综合| 欧美日韩第一区日日骚| 日韩高清一级片| 91精品国产综合久久小美女| 日韩av中文在线观看| 国产精品免费av| 成人av高清在线| 综合亚洲深深色噜噜狠狠网站| www.日韩大片| 一区二区在线观看免费视频播放 | 日日摸夜夜添夜夜添国产精品| 欧美日韩在线三区| 天堂一区二区在线| 6080国产精品一区二区| 蜜臀久久99精品久久久久久9| 欧美大片日本大片免费观看| 激情综合色综合久久综合| 欧美经典一区二区| av一区二区久久| 亚洲中国最大av网站| 91精品中文字幕一区二区三区| 美日韩一区二区| 国产欧美一区二区精品性| 99久久精品免费看国产| 亚洲国产一二三| 日韩午夜精品电影| 国产不卡在线视频| 亚洲在线成人精品| 日韩免费性生活视频播放| 国产成人亚洲精品狼色在线| 亚洲精品伦理在线| 日韩一区二区三区在线视频| 国产高清在线观看免费不卡| 亚洲精品欧美二区三区中文字幕| 欧美一区二区三区四区高清| 黄页网站大全一区二区| 亚洲久草在线视频| 亚洲精品一区二区精华|