Skip to content

Commit

Permalink
Merge branch 'pre_release' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
whutddk committed Jul 8, 2018
2 parents 17fdf11 + 2a64524 commit 615b4f7
Show file tree
Hide file tree
Showing 29 changed files with 22,195 additions and 1,228 deletions.
21,063 changes: 21,063 additions & 0 deletions doc/boot.hex

Large diffs are not rendered by default.

Binary file modified doc/spi2i2s.bin
Binary file not shown.
Binary file modified doc/spi2i2s.bit
Binary file not shown.
1,696 changes: 849 additions & 847 deletions inc/Dsp_assembly.h

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions inc/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@
*----------------------------------------------------------*/

#ifdef INCLUDE_xTimerPendFunctionCall
#undef INCLUDE_xTimerPendFunctionCall
#undef INCLUDE_xTimerPendFunctionCall
#endif

#ifdef configUSE_TIMERS
#undef configUSE_TIMERS
#undef configUSE_TIMERS
#endif

#define INCLUDE_xTimerPendFunctionCall 1
Expand Down
12 changes: 6 additions & 6 deletions inc/fft.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
*/

/*!< the buffer of input and output for fast fourier transform */
typedef struct {
typedef struct {
float real;
float imag;
}compx;
} compx;

/* choose the number of fast fourier transform channel number */
#define fft_16
Expand Down Expand Up @@ -93,7 +93,7 @@ typedef struct {
#ifdef fft_1024
#define fft_N 1024
#define M 32
#endif
#endif

/* fft operation */

Expand All @@ -108,22 +108,22 @@ extern const float cos_tab[fft_N / 2];

/**
* \brief fast fourier transform step1.
* \details Transform real number data to complex number data struct.
* \details Transform real number data to complex number data struct.
* \param[in] the pointer of adc data array.
* \param[in] the pointer of output complex number data struct.
*/
extern void fft_Data(uint8_t *fftIn, compx *fftData);

/**
* \brief fast fourier transform step2.
* \details fast fourier transform the data in array.
* \details fast fourier transform the data in array.
* \param[in] the pointer of input data array and the result would be store in this array after transform.
*/
extern void fft_Convert(compx *xin);

/**
* \brief fast fourier transform step3.
* \details reduce the size of data by calculate the absolute value of complex data.
* \details reduce the size of data by calculate the absolute value of complex data.
* \param[in] the pointer of the complex data after transform.
* \param[in] the pointer of the array storing the compress data.
*/
Expand Down
2 changes: 1 addition & 1 deletion inc/inc_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ inline void _Rtos_Delay(uint32_t ticks)
inline void _Block_Delay( uint32_t ticks )
{
uint32_t cur_time;

cur_time = OSP_GET_CUR_MS();

while ((OSP_GET_CUR_MS() - cur_time) < ticks);
Expand Down
25 changes: 15 additions & 10 deletions inc/include.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

/**
* Global Definition
*
*
*/
/* Define Net Buff and File Buff Size to 15MB */
#define BUFF_SPACE 15728640
Expand All @@ -40,7 +40,7 @@

/**
* Define in filelist.c
*
*
*/
struct filelist {
char data[50]; //Save Song ID or Song Name in different Function
Expand All @@ -61,49 +61,52 @@ extern void filelist_delete();

/**
* Define in main.c
*
*
*/
extern int32_t error_num ; //Used to Get Error Num

/**
* Define in mem.c
*
*
*/
extern void readout_file(char *music_name);

/**
* Define in music.c
*
*
*/
extern DEV_SPI_PTR spi;
extern int8_t file_buff[ BUFF_SPACE ];
extern void play_init();

/**
* Define in dma2spi.c
*
*/
extern void spi_dma_prepare(void);
extern int32_t spi_writeraw(const void *data);
extern int32_t Start_playing();

/**
* Define in mp3api.c
*
*
*/
// extern bool flag_songend;
extern int32_t play_mp3(int32_t filelenth, uint8_t location);

/**
* Define in iosignal.c
*
*
*/
extern void iosignal_init();
extern void iosignal_ctrl(uint8_t val, uint8_t num);
extern uint8_t iosignal_read(uint8_t num);
extern void net_rst();
extern void led_row_ctl(uint8_t rows,uint8_t data);
extern void led_row_ctl(uint8_t rows, uint8_t data);

/**
* Define in net.c
*
*/
extern bool flag_net;
extern char dllink[500];
Expand All @@ -116,12 +119,13 @@ extern void download_mp3();

extern bool flag_netend;
extern uint8_t songid_cnt;
extern DEV_UART_PTR uart_obj; //Pointer to Get UART State in Task
extern DEV_UART_PTR uart_obj; //Pointer to Get UART State in Task



/**
* Define in GUI.c
*
*/
struct _gui_info {
uint8_t screen_point; //Mark Which Page or Which Song is Pointed
Expand Down Expand Up @@ -149,8 +153,9 @@ extern void reflash_screen();

/**
* Define in key.c
*
*
*/

extern void key1_isr();
extern void key2_isr();
extern void key3_isr();
Expand Down
10 changes: 5 additions & 5 deletions inc/oled.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#ifndef __OLED_H_
#define __OLED_H_
#define __OLED_H_



#define SIZE 16
#define XLevelL 0x02
#define XLevelH 0x10
#define Max_Column 128
#define Max_Row 64
#define Brightness 0xFF
#define Brightness 0xFF
#define X_WIDTH 128
#define Y_WIDTH 64
#define Y_WIDTH 64

extern const uint8_t mushroom[];
extern const uint8_t sky1[];
Expand Down Expand Up @@ -43,6 +43,6 @@ extern void OLED_P8x16Str(uint8_t x, uint8_t y, uint8_t ch[]);
extern void OLED_P14x16Str(uint8_t x, uint8_t y, uint8_t ch[]);
extern void draw_fft();

#endif
#endif


36 changes: 0 additions & 36 deletions inc/ssd1306_app_config.h.bk

This file was deleted.

6 changes: 3 additions & 3 deletions linker_file.ldf
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ SECTIONS
KEEP (*(.init_vector))
KEEP (*(.init_bootstrap))
_e_init = .;
} > ICCM
} > EXT_RAM
.vector : ALIGN(1024)
{
_f_vector = .;
*(.vector)
_e_vector = .;
} > ICCM
} > EXT_RAM
.text : ALIGN(4)
{
_f_text = .;
*(.text .text.* .gnu.linkonce.t.*)
_e_text = .;
} > ICCM
} > EXT_RAM
.rodata : ALIGN(4)
{
_f_rodata = .;
Expand Down
9 changes: 5 additions & 4 deletions src/FFT/fft.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
void fft_Data(uint8_t *fftIn, compx *fftData)
{
int i = 0;

for ( i = 0; i < fft_N; i++ ) {
fftData[List[i]].real = (float)fftIn[i]; /* Copy the data to fft,using the method of search the table */
fftData[List[i]].imag = 0; /* Clear the imaginary part */
Expand All @@ -75,13 +76,16 @@ void fft_Convert(compx *xin)
{
uint16_t i, j, L, p, le, B, ip;
compx t, ws;

for (L = 1; L <= M; L++) {
le = (2 << L) >> 1;
B = le / 2;

for (j = 0; j <= B - 1; j++) {
p = (((2 << M) >> L) >> 1) * j;
ws.real = cos_tab[p];
ws.imag = sin_tab[p];

for (i = j; i <= fft_N - 1; i = i + le) {
ip = i + B;
t.real = xin[ip].real * ws.real - xin[ip].imag * ws.imag;
Expand All @@ -107,6 +111,7 @@ void fft_powerMag(compx *fftData, uint8_t *fftOut)
{
uint8_t i;
uint16_t tempfft = 0;

for (i = 0; i < fft_N / 2; i++) {
fftData[i].real = (float)(sqrt(fftData[i].real * fftData[i].real + fftData[i].imag * fftData[i].imag)
/ (i == 0 ? fft_N : (fft_N / 2)));
Expand All @@ -123,16 +128,12 @@ uint8_t fft_out[fft_N / 2];
compx fft_data[fft_N];
void fft_cal()
{
// uint8_t fft_num = 0;
/* fft data segment */


fft_Data(fft_in, fft_data);
fft_Convert(fft_data); /* FFT resolve */
fft_powerMag(fft_data, fft_out); /* data compress */

// light_mode_music(fft_out);

}

/** @} */
4 changes: 2 additions & 2 deletions src/FFT/fft_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ const int List[16] = {
#ifdef fft_32
/* list table of 16 points for butterfly algorithm of fft */
const int List[32] = {
0, 16, 8, 24,4,20,12,28,2,18,10,26,6,22,14,30,
1, 17, 9, 25,5,21,13,29,3,19,11,27,7,23,15,31
0, 16, 8, 24, 4, 20, 12, 28, 2, 18, 10, 26, 6, 22, 14, 30,
1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7, 23, 15, 31
};
#endif

Expand Down
Loading

0 comments on commit 615b4f7

Please sign in to comment.