| #include "mbtk_audio_gain.h" |
| #include "mbtk_log.h" |
| |
| static void help() |
| { |
| printf("./mbtk_dsp_gain_set spk/mic <gain>\n"); |
| } |
| |
| int main(int argc, char *argv[]) |
| { |
| if(argc != 3) { |
| help(); |
| return -1; |
| } |
| |
| if(strcmp(argv[1], "spk") && strcmp(argv[1], "mic")) { |
| help(); |
| return -1; |
| } |
| |
| mbtk_log_init("radio", "MBTK_GAIN"); |
| |
| CONFIG_DSPGAIN_Direction dir = CONFIG_DSPGAIN_RX; |
| if(!strcmp(argv[1], "mic")) { |
| dir = CONFIG_DSPGAIN_TX; |
| } |
| if(mbtk_dsp_gain_set(dir, atoi(argv[2]))) { |
| printf("\nFail.\n"); |
| } else { |
| printf("\nSuccess.\n"); |
| } |
| |
| return 0; |
| } |
| |
| |