speex移植到crotex-M4,注意事项
1.需要定义一些基本数据类型
在speex_types.h有关基本数据的定义。里面包含了CPU结构相关的数据定义了。假如没有要移植的CPU的,则需要在speex/speex_config_types.h这个文件中定义了。由于没有ARM的,所以要自己定义这个文件。在include/speex目录中有一个speex_config_types.h.in的文件。我们拷贝一份并把文件名改为speex_config_types.h。进入文件可见
#ifndef __SPEEX_TYPES_H__#define __SPEEX_TYPES_H__/* these are filled in by configure */typedef @SIZE16@ spx_int16_t;typedef unsigned @SIZE16@ spx_uint16_t;typedef @SIZE32@ spx_int32_t;typedef unsigned @SIZE32@ spx_uint32_t;#endif
改成:
#ifndef _SPEEX_CONFIG_TYPES_H#define _SPEEX_CONFIG_TYPES_H typedef signed short spx_int16_t; typedef unsigned short spx_uint16_t; typedef signed int spx_int32_t; typedef unsigned int spx_uint32_t; #endif /* _SPEEX_CONFIG_TYPES_H */
这样就完成基本数据的定义了。
2.需要需要启动文件中定义的heap的大小
找到Heap_Size的定义改成
Heap_Size EQU 0x00008000
如果没有改heap的大小会出现莫名其妙的错误或fault
3.需要在工程的宏定义中定义HAVE_CONFIG_H