fixed weirdness

sipo
Ondřej Hruška 7 years ago
parent 63a7852554
commit 334a89f055
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 6
      framework/rsc_enum.h
  2. 7
      platform/irq_dispatcher.c

@ -68,7 +68,7 @@ typedef uint8_t ResourceMap[RSCMAP_LEN];
static inline bool rscmap_is_free(ResourceMap *rscmap, Resource rsc)
{
return (0 == (*rscmap[((rsc)>>3)&0xFF] & (1<<((rsc)&0x7))));
return (0 == ((*rscmap)[((rsc)>>3)&0xFF] & (1<<((rsc)&0x7))));
}
static inline bool rscmap_is_held(ResourceMap *rscmap, Resource rsc)
@ -78,12 +78,12 @@ static inline bool rscmap_is_held(ResourceMap *rscmap, Resource rsc)
static inline void rscmap_claim(ResourceMap *rscmap, Resource rsc)
{
*rscmap[((rsc)>>3)&0xFF] |= (1<<((rsc)&0x7));
(*rscmap)[((rsc)>>3)&0xFF] |= (1<<((rsc)&0x7));
}
static inline void rscmap_free(ResourceMap *rscmap, Resource rsc)
{
*rscmap[((rsc)>>3)&0xFF] &= ~(1<<((rsc)&0x7));
(*rscmap)[((rsc)>>3)&0xFF] &= ~(1<<((rsc)&0x7));
}
//#define RSC_IS_FREE(rscmap, rsc) (0 == (rscmap[((rsc)>>3)&0xFF] & (1<<((rsc)&0x7))))

@ -85,8 +85,6 @@ void irqd_init(void)
// NVIC_EnableIRQ(TIM1_BRK_UP_TRG_COM_IRQn); /*!< TIM1 Break, Update, Trigger and Commutation Interrupt */ // - handled by hal msp init
// NVIC_EnableIRQ(TIM1_CC_IRQn); /*!< TIM1 Capture Compare Interrupt */
// NVIC_EnableIRQ(USB_IRQn); /*!< USB global Interrupt & EXTI Line18 Interrupt */ // - USB IRQ is handled by the USB library
hexDump("Callbacks", &callbacks, sizeof(callbacks));
}
//void Default_Handler(void)
@ -147,12 +145,7 @@ static struct cbslot *get_slot_for_periph(void *periph)
void irqd_attach(void *periph, IrqCallback callback, void *arg)
{
dbg("Attach irqd for periph %p, cb %p()", periph, callback);
hexDump("Callbacks", &callbacks, sizeof(callbacks));
struct cbslot *slot = get_slot_for_periph(periph);
dbg("slot %p cb is %p()", slot, slot->callback);
assert_param(slot->callback == NULL);
slot->callback = callback;
slot->arg = arg;

Loading…
Cancel
Save