diff options
author | Drew Barbier <dbarbi1@gmail.com> | 2018-07-05 14:14:04 -0500 |
---|---|---|
committer | Drew Barbier <dbarbi1@gmail.com> | 2018-07-05 14:14:04 -0500 |
commit | 24010b53cdc225cea7de8662d0b54425f86f8b61 (patch) | |
tree | 074ee15552b7f93621d568e8193ad12b554a9aa3 /bsp/drivers | |
parent | 962b23a3797ba659577056ed3fc57c2d0a77df62 (diff) |
fix level calculation
Diffstat (limited to 'bsp/drivers')
-rw-r--r-- | bsp/drivers/clic/clic_driver.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; } |