本文整理匯總了C++中EXT_ASSERT函數的典型用法代碼示例。如果您正苦於以下問題:C++ EXT_ASSERT函數的具體用法?C++ EXT_ASSERT怎麽用?C++ EXT_ASSERT使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EXT_ASSERT函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: USB2UART_Sendilm
/* send ilm to UART owner */
void USB2UART_Sendilm(msg_type msgid)
{
ilm_struct *USB2UART_ilm;
void *port_ptr = NULL;
if (USB2UARTPort.ownerid == MOD_DRV_HISR)
return;
switch(msgid)
{
case MSG_ID_UART_READY_TO_READ_IND:
{
uart_ready_to_read_ind_struct *tmp;
tmp = (uart_ready_to_read_ind_struct *)
construct_local_para(sizeof(uart_ready_to_read_ind_struct),TD_UL);
tmp->port = USB2UARTPort.port_no;
port_ptr = tmp;
}
break;
case MSG_ID_UART_READY_TO_WRITE_IND:
{
uart_ready_to_write_ind_struct *tmp;
tmp = (uart_ready_to_write_ind_struct *)
construct_local_para(sizeof(uart_ready_to_write_ind_struct),TD_UL);
tmp->port = USB2UARTPort.port_no;
port_ptr = tmp;
}
break;
case MSG_ID_UART_ESCAPE_DETECTED_IND:
{
uart_escape_detected_ind_struct *tmp;
tmp = (uart_escape_detected_ind_struct *)
construct_local_para(sizeof(uart_escape_detected_ind_struct),TD_UL);
tmp->port = USB2UARTPort.port_no;
port_ptr = tmp;
}
break;
default:
EXT_ASSERT(0, msgid, 0, 0);
break;
}
if (USB2UARTPort.ownerid == MOD_DRV_HISR)
EXT_ASSERT(0, USB2UARTPort.ownerid, 0, 0);
DRV_BuildPrimitive(USB2UART_ilm, MOD_DRV_HISR,
USB2UARTPort.ownerid, msgid, port_ptr);
msg_send_ext_queue(USB2UART_ilm);
}
示例2: functions
/************************************************************
Bulk EP OUT handle functions (clear rx fifo data, read them out and drop)
*************************************************************/
void USB_Acm_Rx_ClrFifo(void)
{
kal_uint32 nCount;
#ifdef USB_20_ENABLE
kal_uint32 max_bulk_pkt_size;
kal_uint8 data[USB_EP_BULK_MAXP_HS];
#else
kal_uint8 data[USB_EP_BULK_MAXP];
#endif
/* check if data received */
nCount = USB_EP_Rx_Pkt_Len(g_UsbACM.rxpipe->byEP);
#ifdef USB_20_ENABLE
if(USB_Is_High_Speed() == KAL_TRUE)
max_bulk_pkt_size = USB_EP_BULK_MAXP_HS;
else
max_bulk_pkt_size = USB_EP_BULK_MAXP_FS;
#ifdef __PRODUCTION_RELEASE__
if(nCount > max_bulk_pkt_size)
{
nCount = max_bulk_pkt_size;
}
#else
EXT_ASSERT((nCount <= max_bulk_pkt_size), nCount, max_bulk_pkt_size, 0);
#endif
#else /* USB_20_ENABLE */
#ifdef __PRODUCTION_RELEASE__
if(nCount > USB_EP_BULK_MAXP)
{
nCount = USB_EP_BULK_MAXP;
}
#else
EXT_ASSERT((nCount <= USB_EP_BULK_MAXP), nCount, USB_EP_BULK_MAXP, 0);
#endif
#endif /* USB_20_ENABLE */
if(nCount>0)
{
/* get the data from fifo */
USB_EPFIFORead(g_UsbACM.rxpipe->byEP, nCount, data);
/* Clear RxPktRdy */
USB_EP_Bulk_Rx_Ready(g_UsbACM.rxpipe->byEP);
}
}
示例3: cccitty_check_ul_gpd_list_sequence
/*!
* @function [static] cccitty_check_ul_gpd_list_sequence
* @brief Traverse the input GPD list and check sequence in the CCCI header
*
* @param first_gpd [IN] pointer to the first GPD in the GPD chain
* @param last_gpd [IN] pointer to the last GPD in the GPD chain
*
* @return kal_uint32 return the gpd number in between first_gpd and last_gpd
*/
static kal_uint32 cccitty_check_ul_gpd_list_sequence(qbm_gpd* first_gpd, qbm_gpd* last_gpd)
{
qbm_gpd *curr_gpd;
qbm_gpd *next_gpd;
kal_uint32 num_gpd;
CCCI_BUFF_T *pdata;
EXT_ASSERT((first_gpd && last_gpd),(kal_uint32)first_gpd, (kal_uint32)last_gpd,0);
curr_gpd = first_gpd;
do {
next_gpd = QBM_DES_GET_NEXT(curr_gpd);
pdata = CCCIDEV_GET_QBM_DATAPTR(curr_gpd);
ccci_debug_check_seq(pdata);
num_gpd ++;
if ( curr_gpd == last_gpd )
{
break;
}
curr_gpd = next_gpd;
} while ( curr_gpd != NULL );
return num_gpd;
}
示例4: USB2UART_ClrTxBuffer
/* clear tx buffer */
static void USB2UART_ClrTxBuffer(UART_PORT port, module_type ownerid)
{
kal_uint32 savedMask;
#ifndef __PRODUCTION_RELEASE__
if(ownerid != USB2UARTPort.ownerid)
{
EXT_ASSERT( 0, (kal_uint32) ownerid, USB2UARTPort.ownerid, 0);
}
#endif
drv_trace0(TRACE_FUNC, USBACM_CLEAR_TX_BUF);
// kal_prompt_trace(MOD_USB, "clrTx\n");
/* stop dma channel if current status is CDC ACM*/
if ( (gUsbDevice.device_type == USB_CDC_ACM) && (USB2UARTPort.initialized == KAL_TRUE)
&&(gUsbDevice.nDevState==DEVSTATE_CONFIG))
{
USB_Stop_DMA_Channel(g_UsbACM.txpipe->byEP, USB_TX_EP_TYPE);
}
savedMask = SaveAndSetIRQMask();
USB2UARTPort.Tx_Buffer.Write = 0;
USB2UARTPort.Tx_Buffer.Read = 0;
g_UsbACM.send_Txilm = KAL_TRUE;
RestoreIRQMask(savedMask);
drv_trace1(TRACE_FUNC, USBACM_CLEAR_TX_BUF_READY_TO_READ_FLAG, ownerid);
// kal_prompt_trace(MOD_USB, "clr RDY W %d", ownerid);
}
示例5: DclSerialPort_Control
DCL_STATUS DclSerialPort_Control(DCL_HANDLE handle, DCL_CTRL_CMD cmd, DCL_CTRL_DATA_T *data)
{
DCL_DEV Device ;
SIO_TYPE_T type;
if(handle == STATUS_INVALID_DEVICE)
return STATUS_FAIL;
if (!DCL_UART_IS_HANDLE_MAGIC(handle))
{
ASSERT(0);
return STATUS_INVALID_DCL_HANDLE;
}
Device = DCL_UART_GET_DEV(handle);
if(Device > UART_DEV_CNT)// if((Device<0)||(Device > UART_DEV_CNT)) remove for build warning,beasese this enum can't < 0
return STATUS_FAIL;
type = SIO_DEV_Drv_Index[Device];
// if the uart driver not init, here will issue assert
if(type == DCL_UART_TYPE)
{
if(SIO_Dev_Driver[type] != Uart_Drv_Handler.SeriportHandlerCb)//maybe bootup trace
EXT_ASSERT(0, (kal_uint32)type, (kal_uint32)Device, (kal_uint32)handle);//please check weather called UART_Boot_Trace_Release(0),when bootup init
}
return SIO_Dev_Driver[type](Device, cmd, data);
}
示例6: VideoCommClrAllQ
void VideoCommClrAllQ(VIDEO_COMM_STATE_T *prCommState)
{
kal_uint32 u4SavedMask;
kal_uint32 i = 0;
u4SavedMask = SaveAndSetIRQMask();
if (prCommState->u4EntryCount != 0)
{
EXT_ASSERT(0, prCommState->u4EntryCount, 0, 0);
}
prCommState->rCmdQ.u4WriteIdx = 0;
prCommState->rCmdQ.u4ReadIdx = 0;
for (;i < VIDEO_PORT_MAX_NUM; i++)
{
prCommState->rInputBuffQ[i].u4WriteIdx = 0;
prCommState->rInputBuffQ[i].u4ReadIdx = 0;
prCommState->rInputBuffQ[i].u4UsedNum= 0;
prCommState->rOutputBuffQ[i].u4WriteIdx = 0;
prCommState->rOutputBuffQ[i].u4ReadIdx = 0;
prCommState->rOutputBuffQ[i].u4UsedNum= 0;
}
RestoreIRQMask(u4SavedMask);
}
示例7: INT_FIQ_Lisr
/*************************************************************************
* FUNCTION
* INT_FIQ_Lisr
*
* DESCRIPTION
* This function implement FIQ handler
*
* CALLS
*
* CALL BY
*
* PARAMETERS
*
* RETURNS
*
*************************************************************************/
void INT_FIQ_Lisr(void)
{
kal_uint8 FIQ_Enter=1;
if (KAL_FALSE == SLA_IsLmuLogging())
{
LMU_Write_ISR_CSM(0xaaaa0fff);
}
if (SA_LoggingIndex != 0)
{
SLA_LoggingLISR(0xaaaa0fff);
}
FIQErrInfo.fiqSelect = FIQ_isValid();
FIQErrInfo.irqReturnAddr = processing_irqlr;
FIQErrInfo.fiqReturnAddr = processing_fiqlr;
if (KAL_FALSE == SLA_IsLmuLogging())
{
LMU_Write_ISR_END_CSM(0xaaaaaaaa);
}
if (SA_LoggingIndex != 0)
{
SLA_LoggingLISR(0xaaaaaaaa);
}
EXT_ASSERT(FIQ_Enter==0, FIQErrInfo.fiqSelect, FIQErrInfo.fiqReturnAddr, FIQErrInfo.irqReturnAddr);
}
示例8: USB2UART_Update_Transmit_Data
/*
Update the buffer information after transmit done
Note that "USB2Uart_WriteLength" will be reset to 0.
This function and "USB2UART_Check_Transmit_Data" function must be pair.
*/
static void USB2UART_Update_Transmit_Data(void)
{
/* update buffer information */
if (USB2Uart_MemType == USBTRX_MEM_ISR)
{
USB2UARTPort.Tx_Buffer_ISR.Read += USB2Uart_WriteLength;
ASSERT(USB2UARTPort.Tx_Buffer_ISR.Read <= USB2UARTPort.Tx_Buffer_ISR.Length);
if (USB2UARTPort.Tx_Buffer_ISR.Read == USB2UARTPort.Tx_Buffer_ISR.Length)
USB2UARTPort.Tx_Buffer_ISR.Read = 0;
}
else if (USB2Uart_MemType == USBTRX_MEM_TASK)
{
USB2UARTPort.Tx_Buffer.Read += USB2Uart_WriteLength;
ASSERT(USB2UARTPort.Tx_Buffer.Read <= USB2UARTPort.Tx_Buffer.Length);
if (USB2UARTPort.Tx_Buffer.Read == USB2UARTPort.Tx_Buffer.Length)
USB2UARTPort.Tx_Buffer.Read = 0;
}
else
{
EXT_ASSERT(0, USB2Uart_MemType, 0, 0);
}
/* reset to 0*/
USB2Uart_WriteLength = 0;
}
示例9: cccitty_ccci_dl_cb
/*!
* @function cccitty_ccci_dl_cb
* @brief Downlink done handler, called while Tx done callback in HIF
* Context: HIF context e.x. MOD_SIODCORE
* Reference cdcacm_ttyhdr_cmd_put_bytes_ior /ccmni_ipc_dl
* Process: <1> drop the ior if TTYCore doesn't request callback, tty_need_tx_done_cb == DCL_FALSE
* <2> callback p_cccitty->dcl_txdone
*
* @param channel [IN] ccci_channel id
* @param io_request [IN] pointer to uplink io request
*
* @return void
*
*/
void cccitty_ccci_dl_cb(CCCI_CHANNEL_T channel, ccci_io_request_t* io_request){
cccitty_inst_t *p_cccitty = cccitty_get_instance();
cccitty_dev_t *p_cccidev;
cccitty_device_id dev_id = cccitty_get_dl_devid(channel);
if(CCCI_TTY_DEV_CNT == dev_id){
/* cannot find dev_id for channel, please check g_cccitty_ccci_ch_mappping */
return;
}
if(NULL == io_request){
cccitty_trace(CCCI_TTY_ERR, CCCI_TTY_MOD_UL, CCCI_TTY_TR_DL_TXDONE_NULL_IOR, dev_id, channel);
return;
}
// dev_id = cccitty_get_dl_devid(channel);
/* ASSERT if invalid channel number is received */
EXT_ASSERT(dev_id < CCCI_TTY_DEV_CNT, channel, 0, 0);
p_cccidev = cccitty_get_dev_instance(dev_id);
if(DCL_TRUE == p_cccidev->tty_need_tx_done_cb){
/* TTYCore/User requests Tx done callback */
//cccitty_trace(CCCI_TTY_TRACE, CCCI_TTY_MOD_UL, CCCI_TTY_TR_DL_TXDONE_CB, dev_id, channel);
p_cccitty->dcl_txdone(p_cccidev->tty_handler, MOD_CCCITTY, io_request);
}else{
//cccitty_trace(CCCI_TTY_TRACE, CCCI_TTY_MOD_UL, CCCI_TTY_TR_DL_TXDONE_CB_DIS, dev_id, channel);
ccci_dest_ior(io_request);
}
return;
}
示例10: init_gt818_download_module
kal_int32 init_gt818_download_module( kal_uint16 cur_ver, kal_uint8 *firmware_ptr )
{
kal_int32 ret = 0;
outbuf = (kal_uint8 *)get_ctrl_buffer( MAX_BUFFER_LEN );
inbuf = (kal_uint8 *)get_ctrl_buffer( MAX_BUFFER_LEN );
dbgbuf = (kal_char *)get_ctrl_buffer( MAX_BUFFER_LEN );
if ( ( outbuf == NULL ) ||
( inbuf == NULL ) ||
( dbgbuf == NULL ) )
{
EXT_ASSERT(0, (kal_uint32)outbuf, (kal_uint32)inbuf, (kal_uint32)dbgbuf);
return 0;
}
CTP_DWN_DEBUG_LINE_TRACE();
//rst_handle = DclGPIO_Open(DCL_GPIO, GPIO_CTP_SHUTDN_PIN);
//int_handle = DclGPIO_Open(DCL_GPIO, GPIO_CTP_INT_PIN);
int_handle = DclGPIO_Open(DCL_GPIO, gpio_ctp_eint_pin);
rst_handle = DclGPIO_Open(DCL_GPIO, gpio_ctp_reset_pin);
DclGPIO_Control(rst_handle, GPIO_CMD_SET_MODE_0, NULL);
DclGPIO_Control(int_handle, GPIO_CMD_SET_MODE_0, NULL);
DclGPIO_Control(int_handle, GPIO_CMD_SET_DIR_OUT, NULL);
ret = gt818_downloader_probe( cur_ver, firmware_ptr );
//DclGPIO_Control(int_handle, GPIO_CMD_SET_DIR_IN, NULL);
//DclGPIO_Control(int_handle, GPIO_CMD_SET_MODE_1, NULL);
DclGPIO_Control(int_handle, GPIO_CMD_WRITE_HIGH, NULL);
DclGPIO_Control(rst_handle, GPIO_CMD_WRITE_HIGH, NULL);
kal_sleep_task(5);
DclGPIO_Control(rst_handle, GPIO_CMD_WRITE_LOW, NULL);
kal_sleep_task(5);
DclGPIO_Control(rst_handle, GPIO_CMD_WRITE_HIGH, NULL);
kal_sleep_task(120);
free_ctrl_buffer( outbuf );
free_ctrl_buffer( inbuf );
free_ctrl_buffer( dbgbuf );
if ( downloader_errno )
EXT_ASSERT( 0, downloader_errno, 0, 0 );
return ret;
}
示例11: cccitty_process_dl_gpd_list
/*!
* @function [static] cccitty_process_dl_gpd_list
* @brief Traverse the input GPD list and insert the CCCI header on the first BD->data
*
* @param pDevice [IN] pointer to the CCCI_TTY device
* @param first_gpd [IN] pointer to the first GPD in the GPD chain
* @param last_gpd [IN] pointer to the last GPD in the GPD chain
*
* @return kal_uint32 return the gpd number in between first_gpd and last_gpd
*/
static kal_uint32 cccitty_process_dl_gpd_list(cccitty_dev_t* pDevice, qbm_gpd* first_gpd, qbm_gpd* last_gpd)
{ /*process_tx_gpd_list*/
qbm_gpd* current_gpd = NULL;
kal_uint32 pkt_cnt = 0;
kal_uint32 byte_cnt = 0;
kal_uint32 ccci_h_size;
CCCI_BUFF_T *p_ccci_head;
kal_int32 addseqrtn;
//ASSERT(first_gpd && last_gpd);
EXT_ASSERT((first_gpd && last_gpd), pDevice->dev_id, (kal_uint32)first_gpd, (kal_uint32)last_gpd);
current_gpd = first_gpd;
ccci_h_size = sizeof(CCCI_BUFF_T);
ASSERT(ccci_h_size > 0);
do {
//4 <1> append CCCI header CCCI_BUFF_T
#ifdef __CCCI_N_USE_TGPD_EXT__
/*move data buffer pointer forward for ccci header, increase the gpd, bd length*/
CCCITTY_PUSH_QBM_DATAHEAD(current_gpd, ccci_h_size);
p_ccci_head = (CCCI_BUFF_T *)CCCITTY_GET_QBM_DATAPTR(current_gpd);
CCCI_STREAM_SET_LEN(p_ccci_head, CCCITTY_GET_QBM_DATALEN(current_gpd));
#else
/* Store the DL CCCI header in the GPD extention part */
QBM_DES_SET_EXTLEN(current_gpd, ccci_h_size);
p_ccci_head = (CCCI_BUFF_T *)QBM_DES_GET_EXT(current_gpd);
CCCI_STREAM_SET_LEN(p_ccci_head, CCCITTY_GET_QBM_DATALEN(current_gpd)+ccci_h_size);
#endif
/*Construct the CCCI header*/
CCCI_SET_CH_NO(p_ccci_head, pDevice->ccci_ch.cccitty_ch_dl);
/*Add CCCI sequence number*/
addseqrtn = ccci_debug_add_seq(p_ccci_head, CCCI_DEBUG_ASSERT_BIT);
if(addseqrtn != CCCI_SUCCESS)
{
cccitty_trace(CCCI_TTY_ERR, CCCI_TTY_MOD_DL, CCCI_TTY_ADD_DL_SEQ_FAIL, addseqrtn, pDevice->ccci_ch.cccitty_ch_dl);
}
#if CCCITTY_DATA_TRACE_DUMP_ENABLE
if(pDevice->ccci_ch.cccitty_ch_dl != CCCI_MD_LOG_RX){
cccitty_dump_data(CCCITTY_GET_QBM_DATAPTR(current_gpd), CCCITTY_DUMP_SIZE);
}
#endif
QBM_CACHE_FLUSH(p_ccci_head, sizeof(CCCI_BUFF_T));
pkt_cnt++;
byte_cnt += QBM_DES_GET_DATALEN(current_gpd);
if ( current_gpd == last_gpd )
{
break;
}
current_gpd = QBM_DES_GET_NEXT(current_gpd);
} while ( current_gpd != NULL );
return pkt_cnt;
}
示例12: USB_Ms_Change_Register_DiskDriver
void USB_Ms_Change_Register_DiskDriver(kal_uint8 disk_index, USB_DiskDriver_STRUCT *disk_api)
{
/* disk index can not exceed max LUN */
if(disk_index >= USBMS_MAX_DISK[CURRENT_DRV])
EXT_ASSERT(0, (kal_uint32)disk_index, (kal_uint32)USBMS_MAX_DISK[CURRENT_DRV], 0);
USBMS_DISKDRV_API[CURRENT_DRV][disk_index] = disk_api;
}
示例13: tst_catcher_force_me_to_assert
void tst_catcher_force_me_to_assert(void)
{
//When you see this assertion failure, it means someone pressed "ASSERT" button from Catcher or issued assert tcl command.
//In general, users do it to preserve the scene of phone "hang" issue.
//Please communicate with issue submitters before reaching Catcher owners.
kal_bool CATCHER_FORCE_ME_TO_ASSERT = KAL_FALSE;
EXT_ASSERT(CATCHER_FORCE_ME_TO_ASSERT, 0, 0, 0);
}
示例14: mdci_dsplogging_d2m_cb
static void mdci_dsplogging_d2m_cb(MDCI_BUFF_T *bufp)
{
if((bufp->reserved>1)||(log_mdci_hdlr == NULL))
EXT_ASSERT(0, (kal_uint32)bufp->reserved, (kal_uint32)log_mdci_hdlr, 0);
log_mdci_hdlr(((MDCI_STREAM_T *)(bufp))->addr, ((MDCI_STREAM_T *)(bufp))->len, bufp->reserved);
}
示例15: USB_Ms_Set_Current_Driver
kal_uint8 USB_Ms_Set_Current_Driver(kal_uint32 drv)
{
if( (drv == LOGIC_DRIVE_MS)||(drv == LOGIC_DRIVE_CDROM))
CURRENT_DRV = drv;
else
EXT_ASSERT(0, drv, 0, 0);
return (USBMS_MAX_DISK[CURRENT_DRV]-1);
}