Added a mouse driver adapter.

This adapter allows to use cc65 loadable mouse drivers for Contiki. Generally it should be usable for all cc65-based targets which have a *.mou driver file.

Remarks:
1. For memory consumption reasons the adapter doesn't call mouse_load_driver(). Instead it reuses the target-specific Contiki code to load modules and then calls mouse_install() explicitly.

2. As ctk_mouse_init() is a void function the adapter tracks internally if the mouse initialization failed and blocks then further calls to the driver. Please note that the mouse position remains at 0,0 in that scenario, which is just fine because the Contiki menu doesn't have a mouse-over behaviour (in contrast to the Contiki windows).

3. The adapter never calls mouse_uninstall(). The primary reason is that Contiki generally doesn't care that much ;-) about a clean shutdown. The Apple2 target support a clean shutdown via Ctrl-Reset which stops all interrupt sources by hardware so there's no need for a mouse_uninstall() in this case. If there should be a scenario which really needs mouse_uninstall() being called then atexit() might be worth considering.
2 files changed
tree: 9c581d8e0f4e104b9da16d2f167232601a390fc7
  1. contiki-cc65/