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

📄 mp3.h

📁 Build ourself a MP3 Player
💻 H
字号:
#define BUTTON_NEXT 2
#define BUTTON_PREV 3
#define BUTTON_PAUSE 4

#define NEXT_TRACK 2
#define PREV_TRACK 3
#define PLAYPAUSE 4
#define STOP 5
boolean PAUSED = false;

#define EE_LASTVOLUME  2

void step() {
   printf("step ");
   getc();
}


void halt() {
   printf("halting");
   while (1);
}

int fromHex(char hex) {
   if(hex >= '0' && hex <= '9')
      return(hex - 48); // 0 --> 0
   if(hex >= 'a' && hex <= 'f')
      return(hex - 87);  // a --> 10
   if(hex >= 'A' && hex <= 'F')
      return(hex - 55); // A --> 10

   // Still here?  Invalid
   return(20);        
}


void blink_led(void) {/*
	output_high(LED);
	delay_ms(100);
	output_low(LED);*/
}

byte ScanHex() {
   char c; 
   byte hex = 20;
   byte ret;
   while (hex == 20) {
      c = getc();
      hex = fromHex(c);
   }
   putc(c);
   ret = hex << 4;
   hex = 20;
   while (hex == 20) {
      c = getc();
      hex = fromHex(c);
   }
   putc(c);
   ret |= hex;
   return ret;
}

int16 Scan16Hex() {
   int16 ret;

   ret = ScanHex() << 8;
   ret |= ScanHex();
   return ret;
}

int32 Scan32Hex() {
   int32 ret;

   ret = Scan16Hex() << 16;
   ret |= Scan16Hex();
   return ret;
}
   
   
   
   

⌨️ 快捷键说明

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