2022-08-15 04:20:27 -05:00
|
|
|
/***************************************************************************
|
|
|
|
*
|
|
|
|
* Copyright 2015-2019 BES.
|
|
|
|
* All rights reserved. All unpublished rights reserved.
|
|
|
|
*
|
|
|
|
* No part of this work may be used or reproduced in any form or by any
|
|
|
|
* means, or stored in a database or retrieval system, without prior written
|
|
|
|
* permission of BES.
|
|
|
|
*
|
|
|
|
* Use of this work is governed by a license granted by BES.
|
|
|
|
* This work contains confidential and proprietary information of
|
|
|
|
* BES. which is protected by copyright, trade secret,
|
|
|
|
* trademark and other intellectual property rights.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
// Standard C Included Files
|
|
|
|
#include "cqueue.h"
|
|
|
|
#include "hal_timer.h"
|
|
|
|
#include "hal_trace.h"
|
2023-02-01 14:52:54 -06:00
|
|
|
#include "hal_uart.h"
|
|
|
|
#include <math.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2022-08-15 04:20:27 -05:00
|
|
|
|
2023-02-01 14:52:54 -06:00
|
|
|
uint8_t digmic_buf[100 * 1024];
|
2022-08-15 04:20:27 -05:00
|
|
|
uint32_t digmic_buf_len = 0;
|
|
|
|
|
2023-02-01 14:52:54 -06:00
|
|
|
uint32_t dig_mic_audio_more_data(uint8_t *buf, uint32_t len) {
|
|
|
|
TRACE(2, "%s:%d\n", __func__, __LINE__);
|
|
|
|
memcpy(buf, digmic_buf, len);
|
2022-08-15 04:20:27 -05:00
|
|
|
|
2023-02-01 14:52:54 -06:00
|
|
|
return len;
|
2022-08-15 04:20:27 -05:00
|
|
|
}
|
2023-02-01 14:52:54 -06:00
|
|
|
uint32_t dig_mic_audio_data_come(uint8_t *buf, uint32_t len) {
|
|
|
|
TRACE(2, "%s:%d\n", __func__, __LINE__);
|
2022-08-15 04:20:27 -05:00
|
|
|
|
2023-02-01 14:52:54 -06:00
|
|
|
memcpy(digmic_buf + digmic_buf_len, buf, len);
|
2022-08-15 04:20:27 -05:00
|
|
|
|
|
|
|
#if 1
|
2023-02-01 14:52:54 -06:00
|
|
|
digmic_buf_len = (digmic_buf_len + len) % (100 * 1024);
|
2022-08-15 04:20:27 -05:00
|
|
|
#endif
|
2023-02-01 14:52:54 -06:00
|
|
|
return len;
|
2022-08-15 04:20:27 -05:00
|
|
|
}
|