From 24010b53cdc225cea7de8662d0b54425f86f8b61 Mon Sep 17 00:00:00 2001 From: Drew Barbier Date: Thu, 5 Jul 2018 14:14:04 -0500 Subject: fix level calculation --- bsp/drivers/clic/clic_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bsp') diff --git a/bsp/drivers/clic/clic_driver.c b/bsp/drivers/clic/clic_driver.c index 66b24d6..0612e58 100644 --- a/bsp/drivers/clic/clic_driver.c +++ b/bsp/drivers/clic/clic_driver.c @@ -92,7 +92,7 @@ uint8_t clic_set_int_level( clic_instance_t * this_clic, uint32_t source, uint8_ //shift level right to mask off unused bits level = level>>((this_clic->num_config_bits)-nlbits); //plus this_clic->nmbits which is always 0 for now. //shift level into correct bit position - level = level << (8-((this_clic->num_config_bits)-nlbits)); + level = level << (8-this_clic->num_config_bits) + (this_clic->num_config_bits - nlbits); //write to clicintcfg uint8_t current_intcfg = clic_get_intcfg(this_clic, source); @@ -114,7 +114,7 @@ uint8_t clic_get_int_level( clic_instance_t * this_clic, uint32_t source) { level = level >> (8-(this_clic->num_config_bits)); //shift level right to mask off priority bits - level = level>>((this_clic->num_config_bits)-nlbits); //this_clic->nmbits which is always 0 for now. + level = level>>(this_clic->num_config_bits-nlbits); //this_clic->nmbits which is always 0 for now. return level; } -- cgit v1.2.3