Do you have debug options enabled? if so, what you are experiencing is not a crash but a controlled stop caused by the misplaced chSysLock()/chSysUnlock() around a normal function.
You should be stopped in port_halt() and the global variable dbg_panic_msg should point to an error message.
About the "why 1?", you have a mask of pending events, you are associating that event source to the bit 1 of the mask, this is useful in case your thread registers on multiple sources, each one would be assigned to a different bit.
Giovanni
Reading serial port with event handler
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times