本文整理汇总了C++中HAL_DISABLE_INTERRUPTS函数的典型用法代码示例。如果您正苦于以下问题:C++ HAL_DISABLE_INTERRUPTS函数的具体用法?C++ HAL_DISABLE_INTERRUPTS怎么用?C++ HAL_DISABLE_INTERRUPTS使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HAL_DISABLE_INTERRUPTS函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cyg_drv_interrupt_unmask
externC void cyg_drv_interrupt_unmask( cyg_vector_t vector )
{
CYG_INTERRUPT_STATE old_ints;
CYG_REPORT_FUNCTION();
CYG_REPORT_FUNCARG1("vector=%d", vector);
CYG_ASSERT( vector >= CYGNUM_HAL_ISR_MIN, "Invalid vector");
CYG_ASSERT( vector <= CYGNUM_HAL_ISR_MAX, "Invalid vector");
HAL_DISABLE_INTERRUPTS(old_ints);
HAL_INTERRUPT_UNMASK( vector );
HAL_RESTORE_INTERRUPTS(old_ints);
CYG_REPORT_RETURN();
}
示例2: MCF5272_uart_start_xmit
/*******************************************************************************
MCF5272_uart_start_xmit() - Enable the transmitter on the device.
INPUT:
chan - pointer to the serial private data.
*/
static void MCF5272_uart_start_xmit(serial_channel *chan)
{
CYG_INTERRUPT_STATE int_state;
MCF5272_uart_info_t * port = (MCF5272_uart_info_t *) chan->dev_priv;
/* Enable the UART transmit. */
MCF5272_UART_WRITE(port->base->ucr, MCF5272_UART_UCR_TXEN);
/* Enable transmit interrupt */
HAL_DISABLE_INTERRUPTS(int_state);
port->imr_mirror |= MCF5272_UART_UIMR_TXRDY;
MCF5272_UART_WRITE(port->base->uisr_uimr, port->imr_mirror);
HAL_RESTORE_INTERRUPTS(int_state);
}
示例3: s3esk_eth_send
//
// This routine is called to send data to the hardware.
static void
s3esk_eth_send(struct eth_drv_sc *sc, struct eth_drv_sg *sg_list, int sg_len,
int total_len, unsigned long key)
{
struct s3esk_eth_info *qi = (struct s3esk_eth_info *)sc->driver_private;
volatile char *bp;
int i;
#ifdef CYGPKG_NET
cyg_uint32 int_state;
HAL_DISABLE_INTERRUPTS(int_state);
// FIXME: closer to Send
#endif
//can be send max 1500 bytes
// Set up buffer
qi->txlength = total_len;
bp = qi->txbuf;
qi->sended = 0;
for (i = 0; i < sg_len; i++)
{
memcpy((void *)bp, (void *)sg_list[i].buf, sg_list[i].len);
bp += sg_list[i].len;
}
cyg_uint32 len = qi->txlength - qi->sended;
if(len > CYGNUM_DEVS_ETH_POWERPC_S3ESK_BUFSIZE) len = CYGNUM_DEVS_ETH_POWERPC_S3ESK_BUFSIZE;
//XEmacLite_SetMacAddress(&qi->dev, qi->enaddr);
if (XEmacLite_Send(&qi->dev, qi->txbuf + qi->sended, len) != XST_SUCCESS) {
deferred = 1;
}
else
{
qi->sended += len;
if(qi->sended >= qi->txlength) deferred = 0;
else deferred = 1;
}
// sg_list can be freed! (maybe deferred)
(sc->funs->eth_drv->tx_done)(sc, key, 0);
#ifdef CYGPKG_NET
HAL_RESTORE_INTERRUPTS(int_state);
#endif
}
示例4: trampoline
static void
trampoline(unsigned long entry)
{
typedef void code_fun(void);
code_fun *fun = (code_fun *)entry;
unsigned long oldints;
HAL_DISABLE_INTERRUPTS(oldints);
#ifdef HAL_ARCH_PROGRAM_NEW_STACK
HAL_ARCH_PROGRAM_NEW_STACK(fun);
#else
(*fun)();
#endif
HAL_THREAD_LOAD_CONTEXT(&saved_context);
}
示例5: cyg_hal_report_abort_data
void cyg_hal_report_abort_data(HAL_SavedRegisters *frame)
{
#ifdef CYGPKG_HAL_SMP_SUPPORT
HAL_SMP_CPU_TYPE cpu;
cpu = HAL_SMP_CPU_THIS();
#endif
int old;
HAL_DISABLE_INTERRUPTS(old);
#ifdef CYGPKG_HAL_SMP_SUPPORT
diag_printf("[ABORT DATA] CPU: %d Frame:\n", cpu);
#else
diag_printf("[ABORT DATA] Frame:\n");
#endif
dump_frame((unsigned char *)frame);
HAL_RESTORE_INTERRUPTS(old);
}
示例6: cyg_hal_report_software_interrupt
void cyg_hal_report_software_interrupt(HAL_SavedRegisters *frame)
{
#ifdef CYGPKG_HAL_SMP_SUPPORT
HAL_SMP_CPU_TYPE cpu;
cpu = HAL_SMP_CPU_THIS();
#endif
int old;
HAL_DISABLE_INTERRUPTS(old);
#ifdef CYGPKG_HAL_SMP_SUPPORT
diag_printf("[SOFTWARE INTERRUPT] CPU: %d Frame:\n", cpu);
#else
diag_printf("[SOFTWARE INTERRUPT] Frame:\n");
#endif
dump_frame((unsigned char *)frame);
HAL_RESTORE_INTERRUPTS(old);
}
示例7: cyg_hal_report_undefined_instruction
// Debug routines
void cyg_hal_report_undefined_instruction(HAL_SavedRegisters *frame)
{
#ifdef CYGPKG_HAL_SMP_SUPPORT
HAL_SMP_CPU_TYPE cpu;
cpu = HAL_SMP_CPU_THIS();
#endif
int old;
HAL_DISABLE_INTERRUPTS(old);
#ifdef CYGPKG_HAL_SMP_SUPPORT
diag_printf("[UNDEFINED INSTRUCTION] CPU: %d Frame:\n", cpu);
#else
diag_printf("[UNDEFINED INSTRUCTION] Frame:\n");
#endif
dump_frame((unsigned char *)frame);
HAL_RESTORE_INTERRUPTS(old);
}
示例8: post_dsr
static void post_dsr( cyg_interrupt *intr )
{
CYG_INTERRUPT_STATE old_intr;
CYG_REPORT_FUNCTION();
HAL_DISABLE_INTERRUPTS(old_intr);
if( intr->dsr_count++ == 0 )
{
intr->next_dsr = dsr_list;
dsr_list = intr;
}
HAL_RESTORE_INTERRUPTS(old_intr);
CYG_REPORT_RETURN();
}
示例9: halAssertHazardLights
/**************************************************************************************************
* @fn halAssertHazardLights
*
* @brief Blink LEDs to indicate an error.
*
* @param none
*
* @return none
**************************************************************************************************
*/
void halAssertHazardLights(void)
{
/* disable all interrupts before anything else */
HAL_DISABLE_INTERRUPTS();
/*-------------------------------------------------------------------------------
* Master infinite loop.
*/
for (;;)
{
HAL_LED_BLINK_DELAY();
/* toggle LEDS */
HAL_TOGGLE_LED1();
HAL_TOGGLE_LED2();
}
}
示例10: show_frame_out
void
show_frame_out(HAL_SavedRegisters *frame)
{
#ifdef CYGPKG_HAL_SMP_SUPPORT
HAL_SMP_CPU_TYPE cpu;
cpu = HAL_SMP_CPU_THIS();
#endif
int old;
HAL_DISABLE_INTERRUPTS(old);
#ifdef CYGPKG_HAL_SMP_SUPPORT
diag_printf("[OUT] CPU: %d IRQ Frame:\n", cpu);
#else
diag_printf("[OUT] IRQ Frame:\n");
#endif
dump_frame((unsigned char *)frame);
HAL_RESTORE_INTERRUPTS(old);
}
示例11: flash_run_command
static int
flash_run_command(cyg_uint32 address,
cyg_uint32 command,
cyg_uint32 timeout)
{
cyg_uint32 retcode;
cyg_uint32 fsr;
cyg_uint32 mask;
cyg_uint32 page;
page = ((cyg_uint32) address - (cyg_uint32) flash_info.start) /
flash_info.block_size;
// Wait for the last command to finish
retcode = flash_wait_for_controller(timeout);
if (retcode != FLASH_ERR_OK){
return retcode;
}
HAL_DISABLE_INTERRUPTS(mask);
HAL_WRITE_UINT32(AT91_MC+AT91_MC_FCR,
command |
((page & AT91_MC_FCR_PAGE_MASK) << AT91_MC_FCR_PAGE_SHIFT) |
AT91_MC_FCR_KEY);
retcode = flash_wait_for_controller(timeout);
HAL_RESTORE_INTERRUPTS(mask);
if (retcode != FLASH_ERR_OK){
return retcode;
}
// Check for an error
HAL_READ_UINT32(AT91_MC+AT91_MC_FSR, fsr);
if ((fsr & AT91_MC_FSR_LOCKE) == AT91_MC_FSR_LOCKE)
return FLASH_ERR_PROTECT;
if ((fsr & AT91_MC_FSR_PROGE) == AT91_MC_FSR_PROGE)
return FLASH_ERR_PROGRAM;
return FLASH_ERR_OK;
}
示例12: hal_diag_write_char
void hal_diag_write_char(char c)
{
unsigned long __state;
HAL_DISABLE_INTERRUPTS(__state);
if(c == '\n')
{
#if defined (CYG_KERNEL_DIAG_SERIAL)
cyg_hal_plf_serial_putc(NULL, '\r');
cyg_hal_plf_serial_putc(NULL, '\n');
#endif
#if defined(CYG_KERNEL_DIAG_BUFFER)
hal_diag_buffer[hal_diag_buffer_pos++] = c;
if (hal_diag_buffer_pos >= sizeof(hal_diag_buffer) )
hal_diag_buffer_pos = 0;
#endif
#if defined(CYG_KERNEL_DIAG_GDB)
gdb_diag_write_char(c);
#endif
}
else if (c == '\r')
{
// Ignore '\r'
}
else
{
#if defined(CYG_KERNEL_DIAG_SERIAL)
cyg_hal_plf_serial_putc(NULL, c);
#endif
#if defined(CYG_KERNEL_DIAG_BUFFER)
hal_diag_buffer[hal_diag_buffer_pos++] = c;
if (hal_diag_buffer_pos >= sizeof(hal_diag_buffer) )
hal_diag_buffer_pos = 0;
#endif
#if defined(CYG_KERNEL_DIAG_GDB)
gdb_diag_write_char(c);
#endif
}
HAL_RESTORE_INTERRUPTS(__state);
}
示例13: ppc405_eth_deliver
// Deliver function (ex-DSR) handles the ethernet [logical] processing
static void
ppc405_eth_deliver(struct eth_drv_sc *sc)
{
#ifdef CYGINT_IO_ETH_INT_SUPPORT_REQUIRED
struct ppc405_eth_info *qi = (struct ppc405_eth_info *)sc->driver_private;
cyg_uint32 old_ints;
#endif
ppc405_eth_int(sc);
#ifdef CYGINT_IO_ETH_INT_SUPPORT_REQUIRED
// Allow interrupts to happen again
HAL_DISABLE_INTERRUPTS(old_ints);
cyg_drv_interrupt_acknowledge(qi->ints);
cyg_drv_interrupt_unmask(CYGNUM_HAL_INTERRUPT_MAL_SERR);
cyg_drv_interrupt_unmask(CYGNUM_HAL_INTERRUPT_MAL_TX_EOB);
cyg_drv_interrupt_unmask(CYGNUM_HAL_INTERRUPT_MAL_RX_EOB);
cyg_drv_interrupt_unmask(CYGNUM_HAL_INTERRUPT_MAL_TX_DE);
cyg_drv_interrupt_unmask(CYGNUM_HAL_INTERRUPT_MAL_RX_DE);
cyg_drv_interrupt_unmask(CYGNUM_HAL_INTERRUPT_EMAC0);
HAL_RESTORE_INTERRUPTS(old_ints);
#endif
}
示例14: appForceBoot
/**************************************************************************************************
* @fn appForceBoot
*
* @brief Force the boot loader to run.
*
* input parameters
*
* None.
*
* output parameters
*
* None.
*
* @return None.
*/
void appForceBoot(void)
{
uint16 crc[2];
SBL_NVM_GET(SBL_ADDR_CRC, crc, sizeof(crc));
// A simple check if the image is built for a boot loader is a valid CRC & shadow where expected.
if ((crc[0] == 0xFFFF) || (crc[0] == 0x0000) ||
(crc[1] == 0xFFFF) || (crc[1] == 0x0000) ||
(crc[1] != crc[0]))
{
return;
}
HAL_DISABLE_INTERRUPTS();
crc[0] ^= 0xFFFF; // Only write to zero bits that are not already zero.
crc[1] = 0xFFFF; // No need to write any bits to zero.
SBL_NVM_SET(SBL_ADDR_CRC, crc, sizeof(crc));
HAL_SYSTEM_RESET();
}
示例15: intr_main
void intr_main( void )
{
CYG_INTERRUPT_STATE oldints;
cyg_drv_interrupt_create(CYGNUM_HAL_INTERRUPT_RTC, 1,
ISR_DATA, isr, NULL, &intr_handle, &intr);
cyg_drv_interrupt_attach(intr_handle);
HAL_CLOCK_INITIALIZE( CYGNUM_HAL_RTC_PERIOD );
cyg_drv_interrupt_unmask(CYGNUM_HAL_INTERRUPT_RTC);
HAL_ENABLE_INTERRUPTS();
while( ticks < 10 )
{
}
HAL_DISABLE_INTERRUPTS(oldints);
CYG_TEST_PASS_FINISH("HAL interrupt test");
}