MAX77658 Ultra-Low Power PMIC Mbed Driver
Revision 2:70a11f46a913, committed 2022-08-26
- Comitter:
- Okan Sahin
- Date:
- Fri Aug 26 15:03:09 2022 +0300
- Parent:
- 1:40ef1dc30cb7
- Commit message:
- fix interrupt_handler_list
use number of interrupts as a size of array.
initialize with NULL.
Changed in this revision
MAX77658.cpp | Show annotated file Show diff for this revision Revisions of this file |
MAX77658.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 40ef1dc30cb7 -r 70a11f46a913 MAX77658.cpp --- a/MAX77658.cpp Fri Aug 26 15:02:25 2022 +0300 +++ b/MAX77658.cpp Fri Aug 26 15:03:09 2022 +0300 @@ -45,6 +45,8 @@ i2c_handler = i2c; + interrupt_handler_list = new handler[INT_CHG_END] {}; + if (IRQPin != NC) { irq_disable_all(); post_intr_work_thread = new Thread(); @@ -65,6 +67,9 @@ if (irq_pin) delete irq_pin; + + if (interrupt_handler_list) + delete [] interrupt_handler_list; } int MAX77658::read_register(uint8_t reg, uint8_t *value)
diff -r 40ef1dc30cb7 -r 70a11f46a913 MAX77658.h --- a/MAX77658.h Fri Aug 26 15:02:25 2022 +0300 +++ b/MAX77658.h Fri Aug 26 15:03:09 2022 +0300 @@ -160,7 +160,7 @@ void *cb; }; - handler interrupt_handler_list[22]; + handler *interrupt_handler_list; public: /**