本文整理汇总了C++中print_dbg_ulong函数的典型用法代码示例。如果您正苦于以下问题:C++ print_dbg_ulong函数的具体用法?C++ print_dbg_ulong怎么用?C++ print_dbg_ulong使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_dbg_ulong函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: display_perf_bps
/*! \brief Display results in bps
*/
static void display_perf_bps(U32 bandwidth)
{
if( bandwidth<10000 )
{
print_dbg("Bandwidth: ");
print_dbg(CL_GREEN);
print_dbg_ulong( bandwidth );
print_dbg(CL_BLACK);
print_dbg(" Bps\r\n");
}
/*
else if( bandwidth<10000000 )
{
print_dbg("Bandwidth: ");
print_dbg(CL_GREEN);
print_dbg_ulong( bandwidth/1000 );
print_dbg(CL_BLACK);
print_dbg(" KBps\r\n");
}*/
else
{
print_dbg("Bandwidth: ");
print_dbg(CL_GREEN);
//print_dbg_ulong( bandwidth/1000000 );
print_dbg_ulong( bandwidth/1000 );
print_dbg(CL_BLACK);
print_dbg(" KBps\r\n");
//print_dbg(" MBps\r\n");
}
}
示例2: inode_unpickle
static const u8* inode_unpickle(const u8* src, inode_t* in) {
/// don't need to pickle indices because we recreate the op list from scratch
// only need these flags:
// in->preset = *src++;
// play inclusion flag
in->play = *src++;
print_dbg(" ; opIdx: ");
print_dbg_ulong(in->opIdx);
print_dbg(" ; opInIdx: ");
print_dbg_ulong(in->opInIdx);
print_dbg("; got flag: ");
print_dbg_ulong(in->play);
// dummy byte for alignment
++src;
// dummy byte for alignment
++src;
//// FIXME: dumb, this isn't aligned yet..
// dummy byte for alignment
// ++src;
return src;
}
示例3: inode_unpickle
static const u8* inode_unpickle(const u8* src, inode_t* in) {
/// don't need to pickle indices because we recreate the op list from scratch
// only need these flags:
// in->preset = *src++;
// play inclusion flag
in->play = *src++;
#ifdef PRINT_PICKLE
print_dbg(" ; opIdx: ");
print_dbg_ulong(in->opIdx);
print_dbg(" ; opInIdx: ");
print_dbg_ulong(in->opInIdx);
print_dbg("; got flag: ");
print_dbg_ulong(in->play);
#endif
// dummy byte for alignment
++src;
// dummy byte for alignment
++src;
// dummy byte for alignment
++src;
return src;
}
示例4: onode_unpickle
static const u8* onode_unpickle(const u8* src, onode_t* out) {
u32 v32;
/* // operator output index */
/* src = unpickle_32(src, &v32); */
/* out->opOutIdx = (u8)v32; */
// output target
src = unpickle_32(src, &v32);
out->target = (s16)v32;
/* // index of parent op */
/* src = unpickle_32(src, &v32); */
/* out->opIdx = (s32)v32; */
// preset flag: 32 bits for alignment
// src = unpickle_32(src, &v32);
// out->preset = (u8)v32;
#ifdef PRINT_PICKLE
print_dbg(" ; opIdx: ");
print_dbg_ulong(out->opIdx);
print_dbg(" ; opOutIdx: ");
print_dbg_ulong(out->opOutIdx);
print_dbg(" ; target: ");
print_dbg_ulong(out->target);
#endif
return src;
}
示例5: print_angles
/*! \brief Detect 30 and 60 angles
*/
void print_angles()
{
signed int res;
static xyz_t angle ;
// if ( ! is_acc_slow() ) { return }
if( 0!=(res=is_acc_abs_angle_x(60)) ) angle.x = 60;
else if( 0!=(res=is_acc_abs_angle_x(30)) ) angle.x = 30;
else angle.x = 0 ;
if ( angle.x > 0 )
{
if( res>0 ) print_dbg("LEFT ") ;
else if( res<0 ) print_dbg("RIGHT ") ;
print_dbg_ulong(angle.x) ;
print_dbg("\r\n") ;
}
if( 0!=(res=is_acc_abs_angle_y(60)) ) angle.y = 60;
else if( 0!=(res=is_acc_abs_angle_y(30)) ) angle.y = 30;
else angle.y = 0 ;
if ( angle.y > 0 )
{
if( res>0 ) print_dbg("DOWN ") ;
else if( res<0 ) print_dbg("UP ") ;
print_dbg_ulong(angle.y) ;
print_dbg("\r\n") ;
}
}
示例6: main
/*! \brief This example shows how to access an external RAM connected to the SMC module.
*/
int main(void)
{
// Get base address of SRAM module
volatile uint32_t *sram = SRAM;
// Switch to external oscillator 0.
pm_switch_to_osc0(&AVR32_PM, FOSC0, OSC0_STARTUP);
// Initialize debug serial line
init_dbg_rs232(FOSC0);
// Display a header to user
print_dbg("\x1B[2J\x1B[H\r\nSMC Example\r\n");
print_dbg("Board running at ");
print_dbg_ulong(FOSC0 / 1000000);
print_dbg(" MHz\r\n");
print_dbg("Initializing SRAM...");
// Initialize the external SRAM chip.
smc_init(FOSC0);
print_dbg("done\r\n\r\n");
print_dbg("Testing SRAM...\r\n");
// Test each address location inside the chip with a write/readback
uint32_t total_tests = 0;
uint32_t total_errors = 0;
for (uint32_t total_tests = 0; total_tests < SRAM_SIZE; total_tests++) {
sram[total_tests] = total_tests;
if (total_tests != sram[total_tests]) {
total_errors++;
print_dbg("Error at 0x");
print_dbg_hex((uint32_t)&sram[total_tests]);
print_dbg("\r\n");
}
}
if (total_errors == 0) {
print_dbg("SRAM test successfully completed\r\n");
}
else {
print_dbg("SRAM test completed with ");
print_dbg_ulong(total_errors);
print_dbg(" errors out of ");
print_dbg_ulong(total_tests);
print_dbg(" tests\r\n");
}
while (true);
return 0;
}
示例7: net_print
void net_print(void) {
print_dbg("\r\n net address: 0x");
print_dbg_hex((u32)(net));
print_dbg("\r\n net input count: ");
print_dbg_ulong(net->numIns);
print_dbg("\r\n net output count: ");
print_dbg_ulong(net->numOuts);
print_dbg("\r\n net op count: ");
print_dbg_ulong(net->numOps);
}
示例8: net_toggle_out_preset
// toggle preset inclusion for output
u8 net_toggle_out_preset(u32 id) {
u8 tmp = preset_out_enabled(preset_get_select(), id) ^ 1;
// net->outs[id].preset ^= 1;
// return net->outs[id].preset;
print_dbg("\r\n toggled output-preset_enable");
print_dbg(", out: ");
print_dbg_ulong(id);
print_dbg(", flag: ");
print_dbg_ulong(tmp);
preset_get_selected()->outs[id].enabled = tmp;
return tmp;
}
示例9: display_result
/**
* \brief Output result through usart
*
* \param refhz Frequency of reference clock(Hz)
* \param duration Reference clock cycles
* \param msrhz Frequency of measured clock(Hz)
*/
void display_result(uint32_t refhz, uint32_t duration, uint32_t msrhz)
{
print_dbg("Reference Clock: ");
print_dbg_ulong(refhz);
print_dbg(" Hz\r\n");
print_dbg("Measured Time: ");
print_dbg_ulong(duration);
print_dbg(" reference clock cycle\r\n");
print_dbg("Measured Clock: ");
print_dbg_ulong(msrhz);
print_dbg(" Hz\r\n\n");
}
示例10: handle_key_0
// function keys
void handle_key_0(s32 val) {
if(val == 0) { return; }
if(check_key(0)) {
// select op's inputs on ins page
pages[ePageIns].select = net_op_in_idx(*pageSelect, 0);
print_dbg("\r\n got 1st input index for selected op ( ");
print_dbg_ulong( *pageSelect );
print_dbg(", result : ");
print_dbg_ulong( net_op_in_idx(*pageSelect, 0));
// go to inputs page
set_page(ePageIns);
redraw_ins();
}
show_foot();
}
示例11: bfin_get_num_params
void bfin_get_num_params(volatile u32* num) {
#if 1
*num = 0;
#else
u16 x;
app_pause();
// command
spi_selectChip(BFIN_SPI, BFIN_SPI_NPCS);
spi_write(BFIN_SPI, MSG_GET_NUM_PARAMS_COM);
spi_unselectChip(BFIN_SPI, BFIN_SPI_NPCS);
print_dbg("\r\n : spi_write MSG_GET_NUM_PARAMS");
// read num
spi_selectChip(BFIN_SPI, BFIN_SPI_NPCS);
spi_write(BFIN_SPI, 0); //dont care
spi_read(BFIN_SPI, &x);
spi_unselectChip(BFIN_SPI, BFIN_SPI_NPCS);
*num = (u8)(x & 0xff);
print_dbg("\r\n : spi_read numparams: ");
print_dbg_ulong(*num);
app_resume();
#endif
}
示例12: uhc_enumeration_step15
/**
* \brief Device enumeration step 15
* Enables UHI interfaces
*
* \param add USB address of the setup request
* \param status Transfer status
* \param payload_trans Number of data transfered during DATA phase
*/
static void uhc_enumeration_step15(
usb_add_t add,
uhd_trans_status_t status,
uint16_t payload_trans)
{
UNUSED(add);
if ((status!=UHD_TRANS_NOERROR) || (payload_trans!=0)) {
for(uint8_t i = 0; i < UHC_NB_UHI; i++) {
uhc_uhis[i].uninstall(uhc_dev_enum);
}
uhc_enumeration_error((status == UHD_TRANS_DISCONNECT)?
UHC_ENUM_DISCONNECT : UHC_ENUM_FAIL);
return;
}
// Enable all UHIs supported
for (uint8_t i = 0; i < UHC_NB_UHI; i++) {
#if UHC_PRINT_DBG
print_dbg("\r\n enabling UHI, idx: "); print_dbg_ulong(i);
#endif
uhc_uhis[i].enable(uhc_dev_enum);
}
uhc_enum_try = 0;
UHC_ENUM_EVENT(uhc_dev_enum, UHC_ENUM_SUCCESS);
}
示例13: at45dbx_example_test_multiple_sector
/*! \brief Tests multiple-sector access functions.
*/
static void at45dbx_example_test_multiple_sector(void)
{
U32 position = 252;
U32 nb_sector = 4;
// Initialize counters.
at45dbx_example_error_cnt = 0;
// Write sectors.
print_dbg("\tWriting sectors\r\n");
at45dbx_write_open(position);
at45dbx_write_multiple_sector(nb_sector);
at45dbx_write_close();
// Read written sectors.
print_dbg("\tReading sectors\t");
at45dbx_read_open(position);
at45dbx_read_multiple_sector(nb_sector);
at45dbx_read_close();
if (!at45dbx_example_error_cnt)
{
print_dbg(TEST_SUCCESS);
}
else
{
print_dbg(TEST_FAIL "\t");
print_dbg_ulong(at45dbx_example_error_cnt);
print_dbg(" errors\r\n");
}
}
示例14: handle_key_1
void handle_key_1(s32 val) {
s16 newOut;
if(val == 0) {
return;
}
if(check_key(1)) {
if(altMode) {
print_dbg("\r\n splitting output: ");
print_dbg_ulong(*pageSelect);
newOut = net_split_out(*pageSelect);
*pageSelect = newOut;
redraw_outs();
} else {
// include / exclude in selected preset
// show preset name in head region
draw_preset_name();
// include / exclude in preset
net_toggle_out_preset(*pageSelect);
// re-draw selected line to update inclusion glyph
// render to tmp buffer
render_line(*pageSelect, 0xf);
// copy to scroll with highlight
render_to_scroll_line(SCROLL_CENTER_LINE, 1);
}
}
show_foot();
}
示例15: scaler_amp_init
// init function
void scaler_amp_init(void* scaler) {
ParamScaler* sc = (ParamScaler*)scaler;
print_dbg("\r\n initializing amp scaler for param, label: ");
print_dbg(sc->desc->label);
// check descriptor
if( sc->desc->type != eParamTypeAmp) {
print_dbg("\r\n !!! warning: wrong param type for amp scaler");
print_dbg(" ; this param has type: ");
print_dbg_ulong(sc->desc->type);
}
// init flag for static data
if(initFlag) {
;;
} else {
initFlag = 1;
// assign
tabVal = scaler_get_nv_data(eParamTypeAmp);
tabRep = scaler_get_nv_rep(eParamTypeAmp);
}
sc->inMin = 0;
sc->inMax = (tabSize - 1) << inRshift;
/// FIXME: should consider requested param range,
// and compute a customized multiplier here if necessary.
}