• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ HAL_RESTORE_INTERRUPTS函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中HAL_RESTORE_INTERRUPTS函数的典型用法代码示例。如果您正苦于以下问题:C++ HAL_RESTORE_INTERRUPTS函数的具体用法?C++ HAL_RESTORE_INTERRUPTS怎么用?C++ HAL_RESTORE_INTERRUPTS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了HAL_RESTORE_INTERRUPTS函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: oper_flash_read_id

void oper_flash_read_id(void* data)
/*                                                                           */
/* INPUTS  : o data    Point to a variable to read the  ID                   */
/* OUTPUTS : o data    The ID is stored in data                              */
/* RETURNS : o ---                                                           */
/* DESCRIPTION:                                                              */
/*     Only reads the manufacturer and part number codes for the first       */
/* device(s) in series. It is assumed that any devices in series             */
/* will be of the same type.                                                 */
/* $rtn_hdr_end                                                              */
/*****************************************************************************/
{
#ifndef HAVE_SERIAL_FLASH
    typedef void c_fun(void*);
    c_fun *_flash_query;
#ifndef IROSBOOT
    unsigned long cur_interrupt_state;
    HAL_FLASH_CACHES_STATE(d_cache, i_cache);
#endif

    _flash_query = (c_fun*) __anonymizer(&flash_query);
#ifndef IROSBOOT
    HAL_DISABLE_INTERRUPTS(cur_interrupt_state);
    HAL_FLASH_CACHES_OFF(d_cache, i_cache);
#endif
    (*_flash_query)(data);
#ifndef IROSBOOT
    HAL_FLASH_CACHES_ON(d_cache, i_cache);
    HAL_RESTORE_INTERRUPTS(cur_interrupt_state);
#endif
#else
    flash_query(data);
#endif /* HAVE_SERIAL_FLASH */
    return;
}
开发者ID:Undrizzle,项目名称:yolanda,代码行数:35,代码来源:flash_driver.c


示例2: oper_flash_unlock_block

int oper_flash_unlock_block(void* block)
/*                                                                           */
/* INPUTS  : o block       Block start address                               */
/* OUTPUTS : ----                                                            */
/* RETURNS : o Status of unlock operation                                    */
/* DESCRIPTION:                                                              */
/*     This function will unlock the blocks.                                 */
/* $rtn_hdr_end                                                              */
/*****************************************************************************/
{
    int stat = 0;
#ifndef HAVE_SERIAL_FLASH
    typedef int c_fun(unsigned short *, int, int);
    c_fun *_flash_unlock_block;
#ifndef IROSBOOT
    unsigned long cur_interrupt_state;
    HAL_FLASH_CACHES_STATE(d_cache, i_cache);
#endif

    _flash_unlock_block = (c_fun*) __anonymizer(&flash_unlock_block);
#ifndef IROSBOOT
    HAL_DISABLE_INTERRUPTS(cur_interrupt_state);
    HAL_FLASH_CACHES_OFF(d_cache, i_cache);
#endif
    stat = (*_flash_unlock_block)(block, flash_dev_info->block_size, 0x1);
#ifndef IROSBOOT
    HAL_FLASH_CACHES_ON(d_cache, i_cache);
    HAL_RESTORE_INTERRUPTS(cur_interrupt_state);
#endif
#endif /* HAVE_SERIAL_FLASH */

    return stat;
}
开发者ID:Undrizzle,项目名称:yolanda,代码行数:33,代码来源:flash_driver.c


示例3: oper_flash_write

int oper_flash_write(void* addr, int data)
/*                                                                           */
/* INPUTS  : o addr         Address to which data to be written              */
/*           o data         Data that need to be written                     */
/* OUTPUTS : ----                                                            */
/* RETURNS : o Status of the write operation                                 */
/* DESCRIPTION:                                                              */
/*     This function writes the data to the flash                            */
/*     THIS FUNCTION CONSIDERES THE BLOCK IN UNLOCKED                        */
/*     WRITE ONLY 2 BYTE                                                     */
/* $rtn_hdr_end                                                              */
/*****************************************************************************/
{
    int stat = 0;
#ifndef IROSBOOT
    unsigned long cur_interrupt_state;
    HAL_FLASH_CACHES_STATE(d_cache, i_cache);
    HAL_DISABLE_INTERRUPTS(cur_interrupt_state);
    HAL_FLASH_CACHES_OFF(d_cache, i_cache);
#endif
#ifdef HAVE_SERIAL_FLASH
    flash_program_buf_word(addr,(cs_uint32)data);
#else
    typedef int c_fun(void *, int);
    c_fun *_flash_program_buf_word;
    _flash_program_buf_word = (c_fun*) __anonymizer(&flash_program_buf_word);
    stat = (*_flash_program_buf_word)(addr, data);
#endif /* HAVE_SERIAL_FLASH */
#ifndef IROSBOOT
    HAL_FLASH_CACHES_ON(d_cache, i_cache);
    HAL_RESTORE_INTERRUPTS(cur_interrupt_state);
#endif
    return stat;
}
开发者ID:Undrizzle,项目名称:yolanda,代码行数:34,代码来源:flash_driver.c


示例4: oper_flash_erase_block

int oper_flash_erase_block(void* block)
/*                                                                           */
/* INPUTS  : o block       Block address                                     */
/* OUTPUTS : ----                                                            */
/* RETURNS : o ---                                                           */
/* DESCRIPTION:                                                              */
/*     This function is used to erase a block                                */
/* $rtn_hdr_end                                                              */
/*****************************************************************************/
{
    int stat = 0;
#ifndef IROSBOOT
    unsigned long cur_interrupt_state;
    HAL_FLASH_CACHES_STATE(d_cache, i_cache);
    HAL_DISABLE_INTERRUPTS(cur_interrupt_state);
    HAL_FLASH_CACHES_OFF(d_cache, i_cache);
#endif
#ifdef HAVE_SERIAL_FLASH
    flash_erase_block((cs_uint32)block,0);
#else
    typedef int c_fun(unsigned short *, unsigned int);
    c_fun *_flash_erase_block;

    _flash_erase_block = (c_fun*) __anonymizer(&flash_erase_block);
    stat = (*_flash_erase_block)(block, flash_dev_info->block_size);
#endif /* HAVE_SERIAL_FLASH */
#ifndef IROSBOOT
    HAL_FLASH_CACHES_ON(d_cache, i_cache);
    HAL_RESTORE_INTERRUPTS(cur_interrupt_state);
#endif
    return stat;
}
开发者ID:Undrizzle,项目名称:yolanda,代码行数:32,代码来源:flash_driver.c


示例5: hal_diag_write_char_serial

void hal_diag_write_char_serial( char c )
{
    unsigned long __state;
    HAL_DISABLE_INTERRUPTS(__state);
    cyg_hal_plf_serial_putc(c);
    HAL_RESTORE_INTERRUPTS(__state);
}
开发者ID:lijinlei,项目名称:Kernel_BOOX60,代码行数:7,代码来源:hal_diag.c


示例6: cyg_hal_interrupt_unmask

void cyg_hal_interrupt_unmask( cyg_uint32 vector)
{
    cyg_uint32 reg, _old;
    
    /* done to void race conditions */
    HAL_DISABLE_INTERRUPTS(_old);
    
    switch (vector)
        {
        case CYGNUM_HAL_INTERRUPT_SIO_0:
            HAL_WRITE_UINT32(INTR_COM0_REG, 1);
            HAL_READ_UINT32(INTR_MASK_REG, reg);
            HAL_WRITE_UINT32(INTR_MASK_REG, (reg | ((1 << SERIAL_PORT0_GROUP))));
            break;

        case CYGNUM_HAL_INTERRUPT_SIO_1:
            HAL_WRITE_UINT32(INTR_COM1_REG, 1);
            HAL_READ_UINT32(INTR_MASK_REG, reg);
            HAL_WRITE_UINT32(INTR_MASK_REG, (reg | ((1 << SERIAL_PORT1_GROUP))));
            break;

        default:
            HAL_INTERRUPT_UNMASK_CPU(vector);
	}

    HAL_RESTORE_INTERRUPTS(_old);
    return;
}
开发者ID:perryhg,项目名称:terkos,代码行数:28,代码来源:var_intr.c


示例7: call_dsrs

static void call_dsrs(void)
{
    CYG_REPORT_FUNCTION();
    
    while( dsr_list != NULL )
    {
        cyg_interrupt *intr;
        cyg_int32 count;
        CYG_INTERRUPT_STATE old_intr;

        HAL_DISABLE_INTERRUPTS(old_intr);
        
        intr = dsr_list;
        dsr_list = intr->next_dsr;
        count = intr->dsr_count;
        intr->dsr_count = 0;
        
        HAL_RESTORE_INTERRUPTS(old_intr);

        intr->dsr( intr->vector, count, (CYG_ADDRWORD)intr->data );
    }

    CYG_REPORT_RETURN();
    
}
开发者ID:Joel397,项目名称:Ongoing_work_files,代码行数:25,代码来源:drv_api.c


示例8: _mcount

void
_mcount(void)
{
    int                 ints_enabled;
    HAL_SMP_CPU_TYPE    this_cpu;
    
    HAL_DISABLE_INTERRUPTS(ints_enabled);

    // This cpu is now not going to run any other code. So, did it
    // already own the spinlock?
    this_cpu = HAL_SMP_CPU_THIS();
    if (mcount_cpu != this_cpu) {
        // Nope, so this cannot be a nested call to mcount()
        HAL_SPINLOCK_SPIN(mcount_lock);
        // And no other cpu is executing inside mcount() either
        mcount_cpu  = this_cpu;
        // A possibly-recursive call is now safe.
        __profile_mcount((CYG_ADDRWORD)__builtin_return_address(1),
                         (CYG_ADDRWORD)__builtin_return_address(0));
        // All done.
        mcount_cpu = HAL_SMP_CPU_NONE;
        HAL_SPINLOCK_CLEAR(mcount_lock);
    }
    
    HAL_RESTORE_INTERRUPTS(ints_enabled);
}
开发者ID:EPiCS,项目名称:reconos_v2,代码行数:26,代码来源:hal_misc.c


示例9: hal_clock_read

// Note: The "contract" for this function is that the value is the number
// of hardware clocks that have happened since the last interrupt (i.e.
// when it was reset).  This value is used to measure interrupt latencies.
// However, since the hardware counter runs freely, this routine computes
// the difference between the current clock period and the number of hardware
// ticks left before the next timer interrupt.
void hal_clock_read(cyg_uint32 *pvalue)
{
    int orig;
    HAL_DISABLE_INTERRUPTS(orig);
    *pvalue = clock_period + *PXA2X0_OSCR - *PXA2X0_OSMR0;
    HAL_RESTORE_INTERRUPTS(orig);
}
开发者ID:perryhg,项目名称:terkos,代码行数:13,代码来源:pxa2x0_misc.c


示例10: time0DI

static void time0DI(register cyg_uint32 stride)
{
    register cyg_uint32 j,k;
    volatile cyg_tick_count_t count0;
    cyg_tick_count_t count1;
    cyg_ucount32 t;
    register char c;
    register CYG_INTERRUPT_STATE oldints;

    count0 = cyg_current_time();

    HAL_DISABLE_INTERRUPTS(oldints);
    HAL_DCACHE_SYNC();

    k = 0;
    if ( cyg_test_is_simulator )
        k = 3960;

    for(; k<4000;k++) {
        for(j=0; j<(HAL_DCACHE_SIZE/HAL_DCACHE_LINE_SIZE); j++) {
            HAL_DCACHE_INVALIDATE_ALL();
            c=m[stride*j];
        }
    }
    HAL_RESTORE_INTERRUPTS(oldints);    

    count1 = cyg_current_time();
    t = count1 - count0;
    diag_printf("stride=%d, time=%d\n", stride, t);
}
开发者ID:lijinlei,项目名称:Kernel_BOOX60,代码行数:30,代码来源:kcache1.c


示例11: hal_diag_write_char

void hal_diag_write_char(char c)
{
    CYG_INTERRUPT_STATE old;
    HAL_DISABLE_INTERRUPTS(old);
    cyg_hal_plf_serial_putc(0, c);
    HAL_RESTORE_INTERRUPTS(old);
}
开发者ID:Palantir555,项目名称:ecos-mars-zx3,代码行数:7,代码来源:hal_diag.c


示例12: oper_flash_bulk_write

int oper_flash_bulk_write(void* _addr, void* _data, int len)
/*                                                                           */
/* INPUTS  : o addr         Address to which data to be written              */
/*           o data         Address of Data that need to be written          */
/*           o len          Length of data hat need to be written            */
/* OUTPUTS : ----                                                            */
/* RETURNS : o Status of the write operation                                 */
/* DESCRIPTION:                                                              */
/*     This function writes the bulk data to the flash                       */
/*     THIS FUNCTION UNLOCKS THE BLOCK FIRST BEFORE IT WRITES                */
/* $rtn_hdr_end                                                              */
/*****************************************************************************/
{
    int stat = 0;
#ifndef IROSBOOT
    unsigned long cur_interrupt_state;
    HAL_FLASH_CACHES_STATE(d_cache, i_cache);
    HAL_DISABLE_INTERRUPTS(cur_interrupt_state);
    HAL_FLASH_CACHES_OFF(d_cache, i_cache);
#endif
#ifdef HAVE_SERIAL_FLASH
    flash_program_buf((cs_uint32)_addr,(cs_uint32)_data,len,0,0);
#else
    int size;
    typedef int c_fun(void *, void *, int, unsigned long, int);
    c_fun *_flash_program_buf;
    unsigned char *addr = (unsigned char *)_addr;
    unsigned char *data = (unsigned char *)_data;
    unsigned long tmp;


    _flash_program_buf = (c_fun*) __anonymizer(&flash_program_buf);

    while (len > 0) {
        size = len;
        if (size > flash_dev_info->block_size) size = flash_dev_info->block_size;

        tmp = (unsigned long) addr & (~flash_dev_info->block_mask);
        if (tmp) {
                tmp = flash_dev_info->block_size - tmp;
                if (size > tmp) size = tmp;
        }

        stat = (*_flash_program_buf)(addr, data, size, flash_dev_info->block_mask, 0x0);
        if (stat != FLASH_ERR_OK) {
            break;
        }
        len -= size;
        addr += size/sizeof(*addr);
        data += size/sizeof(*data);
    }

#endif /* HAVE_SERIAL_FLASH */
#ifndef IROSBOOT
    HAL_FLASH_CACHES_ON(d_cache, i_cache);
    HAL_RESTORE_INTERRUPTS(cur_interrupt_state);
#endif
    return (stat);
}
开发者ID:Undrizzle,项目名称:yolanda,代码行数:59,代码来源:flash_driver.c


示例13: cyg_hal_report_undefined_instruction

// Debug routines
void cyg_hal_report_undefined_instruction(HAL_SavedRegisters *frame)
{
    int old;
    HAL_DISABLE_INTERRUPTS(old);
    diag_printf("[UNDEFINED INSTRUCTION] Frame:\n");
    dump_frame((unsigned char *)frame);
    HAL_RESTORE_INTERRUPTS(old);
}
开发者ID:0xCA5A,项目名称:dd-wrt,代码行数:9,代码来源:hal_misc.c


示例14: cyg_hal_report_exception_handler_returned

void cyg_hal_report_exception_handler_returned(HAL_SavedRegisters *frame)
{    
    int old;
    HAL_DISABLE_INTERRUPTS(old);
    diag_printf("Exception handler returned!\n");
    dump_frame((unsigned char *)frame);
    HAL_RESTORE_INTERRUPTS(old);
}
开发者ID:0xCA5A,项目名称:dd-wrt,代码行数:8,代码来源:hal_misc.c


示例15: cyg_hal_report_abort_data

void cyg_hal_report_abort_data(HAL_SavedRegisters *frame)
{
    int old;
    HAL_DISABLE_INTERRUPTS(old);
    diag_printf("[ABORT DATA] Frame:\n");
    dump_frame((unsigned char *)frame);
    HAL_RESTORE_INTERRUPTS(old);
}
开发者ID:0xCA5A,项目名称:dd-wrt,代码行数:8,代码来源:hal_misc.c


示例16: cyg_hal_report_software_interrupt

void cyg_hal_report_software_interrupt(HAL_SavedRegisters *frame)
{
    int old;
    HAL_DISABLE_INTERRUPTS(old);
    diag_printf("[SOFTWARE INTERRUPT] Frame:\n");
    dump_frame((unsigned char *)frame);
    HAL_RESTORE_INTERRUPTS(old);
}
开发者ID:0xCA5A,项目名称:dd-wrt,代码行数:8,代码来源:hal_misc.c


示例17: hal_diag_write_char

void hal_diag_write_char(char c)
{
#if defined(CYG_KERNEL_DIAG_LCD)
  static volatile CYG_WORD* reg = HAL_DISPLAY_ASCIIPOS0;
#endif

  unsigned long __state;

  HAL_DISABLE_INTERRUPTS(__state);

  if(c == '\n')
    {
#if defined(CYG_KERNEL_DIAG_LCD)
      reg = HAL_DISPLAY_ASCIIPOS0;
      hal_diag_clear_lcd();
#endif
#if defined (CYG_KERNEL_DIAG_SERIAL)
      cyg_hal_plf_serial_putc(NULL, '\r');
      cyg_hal_plf_serial_putc(NULL, '\n');
#endif
    }
  else if (c == '\r')
    {
      // Ignore '\r'
    }
  else
    {
#if defined(CYG_KERNEL_DIAG_LCD)
      if (reg == HAL_DISPLAY_ASCIIPOS0)
        hal_diag_clear_lcd();

      HAL_WRITE_UINT32(reg, c);

      // Advance to next LED position.
      if (reg == HAL_DISPLAY_ASCIIPOS0)
        reg = HAL_DISPLAY_ASCIIPOS1;
      else if (reg == HAL_DISPLAY_ASCIIPOS1)
        reg = HAL_DISPLAY_ASCIIPOS2;
      else if (reg == HAL_DISPLAY_ASCIIPOS2)
        reg = HAL_DISPLAY_ASCIIPOS3;
      else if (reg == HAL_DISPLAY_ASCIIPOS3)
        reg = HAL_DISPLAY_ASCIIPOS4;
      else if (reg == HAL_DISPLAY_ASCIIPOS4)
        reg = HAL_DISPLAY_ASCIIPOS5;
      else if (reg == HAL_DISPLAY_ASCIIPOS5)
        reg = HAL_DISPLAY_ASCIIPOS6;
      else if (reg == HAL_DISPLAY_ASCIIPOS6)
        reg = HAL_DISPLAY_ASCIIPOS7;
      else // reg == HAL_DISPLAY_ASCIIPOS7 or UNKNOWN
        reg = HAL_DISPLAY_ASCIIPOS0;
#endif
#if defined(CYG_KERNEL_DIAG_SERIAL)
      cyg_hal_plf_serial_putc(NULL, c);
#endif
    }

  HAL_RESTORE_INTERRUPTS(__state);
}
开发者ID:KarenHung,项目名称:ecosgit,代码行数:58,代码来源:hal_diag.c


示例18: show_frame_out

void
show_frame_out(HAL_SavedRegisters *frame)
{
    int old;
    HAL_DISABLE_INTERRUPTS(old);
    diag_printf("[OUT] IRQ Frame:\n");
    dump_frame((unsigned char *)frame);
    HAL_RESTORE_INTERRUPTS(old);
}
开发者ID:0xCA5A,项目名称:dd-wrt,代码行数:9,代码来源:hal_misc.c


示例19: tsec_eth_start

//
// This function is called to "start up" the interface.  It may be called
// multiple times, even when the hardware is already running.  It will be
// called whenever something "hardware oriented" changes and should leave
// the hardware ready to send/receive packets.
//
static void tsec_eth_start(struct eth_drv_sc *sc, unsigned char *enaddr,
		int flags)
{
	int link = 0, speed100 = 0, full_duplex = 0;
	struct tsec_eth_info *qi = (struct tsec_eth_info *) sc->driver_private;

	os_printf("ETH start\n");

	//if stopped
	if ((qi->tsec->maccfg1 & (MACCFG1_RXEN| MACCFG1_TXEN)) != (MACCFG1_RXEN
			| MACCFG1_TXEN))
	{
		cyg_uint32 int_state;
		HAL_DISABLE_INTERRUPTS(int_state);
		// Initialize DMACTRL
		qi->tsec->dmactrl &= ~(DMACTRL_GRS| DMACTRL_GTS);

		qi->tsec->tstat = TSTAT_TXF;
		qi->tsec->rstat = RSTAT_QHLT | RSTAT_RXF;

		// Unmask interrupt
		qi->tsec->imask = IMASK_DEFAULT;


		if(flags)
		{
			//redo autonegociation
			phyAutoNegociate(qi->phyAddress, &link, &speed100, &full_duplex);
#ifdef CYGNUM_DEVS_ETH_POWERPC_TSEC_LINK_MODE_Auto
			if (!link)
			{
				//the generic driver will set some flags
				(sc->funs->stop)(sc);
			}
			else
#endif
			{
				//set MAC connection parameters
				qi->tsec->maccfg2 = 0x00007000 | MACCFG2_IF_MODE_NIBBLE
						| MACCFG2_PAD_CRC | ((full_duplex) ? MACCFG2_FULL_DUPLEX
						: 0x0);
				qi->tsec->ecntrl = ECNTRL_STEN | ECNTRL_RMM
						| ((speed100) ? ECNTRL_R100M : 0);

				// Enable Rx and Tx
				qi->tsec->maccfg1 |= (MACCFG1_RXEN| MACCFG1_TXEN);
			}
		}
		else
		{
			qi->tsec->maccfg1 |= (MACCFG1_RXEN| MACCFG1_TXEN);
		}
		HAL_RESTORE_INTERRUPTS(int_state);
	}
}
开发者ID:edgargrimberg,项目名称:eCos_MPC8313,代码行数:61,代码来源:tsec.c


示例20: cyg_drv_spinlock_clear_intsave

void cyg_drv_spinlock_clear_intsave( cyg_drv_spinlock_t *lock,
                                     cyg_addrword_t istate )
{
    CYG_REPORT_FUNCTION();

    lock->lock = 0;
    
    HAL_RESTORE_INTERRUPTS( istate );
    
    CYG_REPORT_RETURN();
}
开发者ID:Joel397,项目名称:Ongoing_work_files,代码行数:11,代码来源:drv_api.c



注:本文中的HAL_RESTORE_INTERRUPTS函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ HAL_RTC_GetDate函数代码示例发布时间:2022-05-30
下一篇:
C++ HAL_READ_UINT8函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap