/* Parameters: irq irq number to be enabled (the irq number NOT the vector number) prio irq priority. 0-15 levels. 0 max priority  */
void set_irq_priority(int irq, int prio)
/* Parameters: irq irq number to be enabled (the irq number NOT the vector number) prio irq priority. 0-15 levels. 0 max priority  */
void set_irq_priority(int irq, int prio)
{
    uint8 *prio_reg;
    prio_reg = (uint8 *)(((uint32)&NVICIP0) + irq);
    *prio_reg = ( (prio&0xF) << (8 - ARM_INTERRUPT_LEVEL_BITS) );             
}