[TASK] Rework debug.c

- Cleanup code
- Change to work in Linux kernel space

Change-Id: Ia4c2fe505edf8da03051ad976bc7bddc60c50d2b
Reviewed-on: http://brateggevoat1/gerrit/1005
Tested-by: Jenkins <jenkins@brateggevoat1.br-automation.co.at>
Reviewed-by: Josef Baumgartner <josef.baumgartner@br-automation.com>
[TASK] Add new functions for kernel control module

- Add ctrlk_getHeartbeat()
- Add ctrlkcal_getStatus() for Linux kernel implementation
- Adapt Linux kernel implementation

Change-Id: If71a67305294b5d84af97bf4ce19f5a9329e8e55
Reviewed-on: http://brateggevoat1/gerrit/1006
Tested-by: Jenkins <jenkins@brateggevoat1.br-automation.co.at>
Reviewed-by: Josef Baumgartner <josef.baumgartner@br-automation.com>