cbToCoNet_u8HwInt()

Explanation

Interrupt handler for hardware interrupts.

circle-info

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

circle-exclamation

Arguments

Type

Name

Remark

uint32

u32DeviceId

Interrupt source

uint32

u32ItemBitmap

Interrupt parameter

Returns

Type

Remark

uint8

FALSE will call cbToCoNet_vHwEvent(), but returning TRUE will not make the call.

circle-info

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;
}

最終更新