cbToCoNet_u8HwInt()

Explanation

Interrupt handler for hardware interrupts.

Due to the lower call delay, it can be used to control external hardware directly by controlling the DIO port.

Interrupt handler processing should be kept to a minimum, and the function should be returned as soon as possible.

Arguments

Type

Name

Remark

uint32

u32DeviceId

Interrupt source

uint32

u32ItemBitmap

Interrupt parameter

Returns

Type

Remark

uint8

Select TRUE if you do not want to overload the application loop with frequent timer interrupts, for example.

Sample code

uint8 cbToCoNet_u8HwInt(uint32 u32DeviceId, uint32 u32ItemBitmap) {
    uint8 u8handled = FALSE;
    switch (u32DeviceId) {
    case E_AHI_DEVICE_TIMER0: // increment countr on TIMER0
        u32counter++;
        u8handled = TRUE; // no vHwEvent()
        break;
    default:
        break;
    }
    return u8handled;
}

最終更新