vxKernel/src/keyboard/keycache.c

81 lines
1.9 KiB
C
Raw Normal View History

#include <vhex/keyboard.h>
VxKernel 0.6.0-13 : Add keyboard API + update timer API @add <> include/vhex/driver/mpu/sh/sh7305/keysc | add internal driver primitives <> include/vhex/driver/mpu/sh/sh7305/tmu | add internal driver primitives <> include/vhex/keyboard | add getkey* (high-level) API | add key event API | add key status API | add keycode information | add keyboard driver interface @update <> include/vhex/driver | add KEYBOARD driver flags <> include/vhex/keyboard | isolate each part of the keyboard module | link the keycache part with the driver-provided keycache information <> src/drivers/mpu/sh/sh7305/keysc | use the new keycache API (high-level interrupt handler) | update keycache API | link the new API in the driver device <> src/drivers/mpu/sh/sh7305/tmu | add timer reservation (WIP) | use a "reservation" cache to known which timer is free instead of hardware | rename internal functions <> src/module/display | Now, by default, DSTACK_CALL() create a pointer on a dstack_call_t | use dsubimage dstack primitive in dimage() @fix <> board/fxcg50/fxcg50.ld | remove the IL-memory and allow only the X-memory area. This because the bootloader uses the IL-memory for DMA transfer and other "low-level" routine used by Gint. Moreover, I originally try to move each "display-driver" in this place, but after some profiling and tests, the dclear()/dupdate() combo went from 9155us up to 33250us (for many reason). So, I keep this area free, but I moved-back from RAM display routines. <> board/fxcg50/initialize | remove "section" copy. This role has been delegated to the bootload (vxBoot) because, in the final ELF file generated by GCC, many relocalization information for the IL/X memory has been set and the bootloader cannot performs general relocalization. So, all "special section/memory" displacement has been moved in the bootloader and we don't have to worrying about the section copy. <> src/drivers/mpu/sh/sh7305/tmu | fix delay calculation in timer reload primitive | disable interruption for profiling timer <> src/module/dislay/ | fix shader index used during the dstack_render() | fix many errors in dimage() shadow render (WIP)
2022-06-24 15:33:36 +02:00
#include <vhex/keyboard/interface.h>
#include <vhex/driver/cpu.h>
VxKernel 0.6.0-13 : Add keyboard API + update timer API @add <> include/vhex/driver/mpu/sh/sh7305/keysc | add internal driver primitives <> include/vhex/driver/mpu/sh/sh7305/tmu | add internal driver primitives <> include/vhex/keyboard | add getkey* (high-level) API | add key event API | add key status API | add keycode information | add keyboard driver interface @update <> include/vhex/driver | add KEYBOARD driver flags <> include/vhex/keyboard | isolate each part of the keyboard module | link the keycache part with the driver-provided keycache information <> src/drivers/mpu/sh/sh7305/keysc | use the new keycache API (high-level interrupt handler) | update keycache API | link the new API in the driver device <> src/drivers/mpu/sh/sh7305/tmu | add timer reservation (WIP) | use a "reservation" cache to known which timer is free instead of hardware | rename internal functions <> src/module/display | Now, by default, DSTACK_CALL() create a pointer on a dstack_call_t | use dsubimage dstack primitive in dimage() @fix <> board/fxcg50/fxcg50.ld | remove the IL-memory and allow only the X-memory area. This because the bootloader uses the IL-memory for DMA transfer and other "low-level" routine used by Gint. Moreover, I originally try to move each "display-driver" in this place, but after some profiling and tests, the dclear()/dupdate() combo went from 9155us up to 33250us (for many reason). So, I keep this area free, but I moved-back from RAM display routines. <> board/fxcg50/initialize | remove "section" copy. This role has been delegated to the bootload (vxBoot) because, in the final ELF file generated by GCC, many relocalization information for the IL/X memory has been set and the bootloader cannot performs general relocalization. So, all "special section/memory" displacement has been moved in the bootloader and we don't have to worrying about the section copy. <> src/drivers/mpu/sh/sh7305/tmu | fix delay calculation in timer reload primitive | disable interruption for profiling timer <> src/module/dislay/ | fix shader index used during the dstack_render() | fix many errors in dimage() shadow render (WIP)
2022-06-24 15:33:36 +02:00
#include <vhex/timer.h>
#include <vhex/driver.h>
#include <stdlib.h>
#include <string.h>
/* Internal cache, used like chained list.
@note:
The KEYSC have 6 key data 16-bits registers this is why we used 6 * 16 = 96
cache slots. */
VxKernel 0.6.0-13 : Add keyboard API + update timer API @add <> include/vhex/driver/mpu/sh/sh7305/keysc | add internal driver primitives <> include/vhex/driver/mpu/sh/sh7305/tmu | add internal driver primitives <> include/vhex/keyboard | add getkey* (high-level) API | add key event API | add key status API | add keycode information | add keyboard driver interface @update <> include/vhex/driver | add KEYBOARD driver flags <> include/vhex/keyboard | isolate each part of the keyboard module | link the keycache part with the driver-provided keycache information <> src/drivers/mpu/sh/sh7305/keysc | use the new keycache API (high-level interrupt handler) | update keycache API | link the new API in the driver device <> src/drivers/mpu/sh/sh7305/tmu | add timer reservation (WIP) | use a "reservation" cache to known which timer is free instead of hardware | rename internal functions <> src/module/display | Now, by default, DSTACK_CALL() create a pointer on a dstack_call_t | use dsubimage dstack primitive in dimage() @fix <> board/fxcg50/fxcg50.ld | remove the IL-memory and allow only the X-memory area. This because the bootloader uses the IL-memory for DMA transfer and other "low-level" routine used by Gint. Moreover, I originally try to move each "display-driver" in this place, but after some profiling and tests, the dclear()/dupdate() combo went from 9155us up to 33250us (for many reason). So, I keep this area free, but I moved-back from RAM display routines. <> board/fxcg50/initialize | remove "section" copy. This role has been delegated to the bootload (vxBoot) because, in the final ELF file generated by GCC, many relocalization information for the IL/X memory has been set and the bootloader cannot performs general relocalization. So, all "special section/memory" displacement has been moved in the bootloader and we don't have to worrying about the section copy. <> src/drivers/mpu/sh/sh7305/tmu | fix delay calculation in timer reload primitive | disable interruption for profiling timer <> src/module/dislay/ | fix shader index used during the dstack_render() | fix many errors in dimage() shadow render (WIP)
2022-06-24 15:33:36 +02:00
struct {
struct keyboard_drv_interface driver;
} keyboard_info;
//---
VxKernel 0.6.0-13 : Add keyboard API + update timer API @add <> include/vhex/driver/mpu/sh/sh7305/keysc | add internal driver primitives <> include/vhex/driver/mpu/sh/sh7305/tmu | add internal driver primitives <> include/vhex/keyboard | add getkey* (high-level) API | add key event API | add key status API | add keycode information | add keyboard driver interface @update <> include/vhex/driver | add KEYBOARD driver flags <> include/vhex/keyboard | isolate each part of the keyboard module | link the keycache part with the driver-provided keycache information <> src/drivers/mpu/sh/sh7305/keysc | use the new keycache API (high-level interrupt handler) | update keycache API | link the new API in the driver device <> src/drivers/mpu/sh/sh7305/tmu | add timer reservation (WIP) | use a "reservation" cache to known which timer is free instead of hardware | rename internal functions <> src/module/display | Now, by default, DSTACK_CALL() create a pointer on a dstack_call_t | use dsubimage dstack primitive in dimage() @fix <> board/fxcg50/fxcg50.ld | remove the IL-memory and allow only the X-memory area. This because the bootloader uses the IL-memory for DMA transfer and other "low-level" routine used by Gint. Moreover, I originally try to move each "display-driver" in this place, but after some profiling and tests, the dclear()/dupdate() combo went from 9155us up to 33250us (for many reason). So, I keep this area free, but I moved-back from RAM display routines. <> board/fxcg50/initialize | remove "section" copy. This role has been delegated to the bootload (vxBoot) because, in the final ELF file generated by GCC, many relocalization information for the IL/X memory has been set and the bootloader cannot performs general relocalization. So, all "special section/memory" displacement has been moved in the bootloader and we don't have to worrying about the section copy. <> src/drivers/mpu/sh/sh7305/tmu | fix delay calculation in timer reload primitive | disable interruption for profiling timer <> src/module/dislay/ | fix shader index used during the dstack_render() | fix many errors in dimage() shadow render (WIP)
2022-06-24 15:33:36 +02:00
// Module init
//---
VxKernel 0.6.0-13 : Add keyboard API + update timer API @add <> include/vhex/driver/mpu/sh/sh7305/keysc | add internal driver primitives <> include/vhex/driver/mpu/sh/sh7305/tmu | add internal driver primitives <> include/vhex/keyboard | add getkey* (high-level) API | add key event API | add key status API | add keycode information | add keyboard driver interface @update <> include/vhex/driver | add KEYBOARD driver flags <> include/vhex/keyboard | isolate each part of the keyboard module | link the keycache part with the driver-provided keycache information <> src/drivers/mpu/sh/sh7305/keysc | use the new keycache API (high-level interrupt handler) | update keycache API | link the new API in the driver device <> src/drivers/mpu/sh/sh7305/tmu | add timer reservation (WIP) | use a "reservation" cache to known which timer is free instead of hardware | rename internal functions <> src/module/display | Now, by default, DSTACK_CALL() create a pointer on a dstack_call_t | use dsubimage dstack primitive in dimage() @fix <> board/fxcg50/fxcg50.ld | remove the IL-memory and allow only the X-memory area. This because the bootloader uses the IL-memory for DMA transfer and other "low-level" routine used by Gint. Moreover, I originally try to move each "display-driver" in this place, but after some profiling and tests, the dclear()/dupdate() combo went from 9155us up to 33250us (for many reason). So, I keep this area free, but I moved-back from RAM display routines. <> board/fxcg50/initialize | remove "section" copy. This role has been delegated to the bootload (vxBoot) because, in the final ELF file generated by GCC, many relocalization information for the IL/X memory has been set and the bootloader cannot performs general relocalization. So, all "special section/memory" displacement has been moved in the bootloader and we don't have to worrying about the section copy. <> src/drivers/mpu/sh/sh7305/tmu | fix delay calculation in timer reload primitive | disable interruption for profiling timer <> src/module/dislay/ | fix shader index used during the dstack_render() | fix many errors in dimage() shadow render (WIP)
2022-06-24 15:33:36 +02:00
/* keycache_init() : keycache constructor */
void keycache_init(void)
{
VxKernel 0.6.0-13 : Add keyboard API + update timer API @add <> include/vhex/driver/mpu/sh/sh7305/keysc | add internal driver primitives <> include/vhex/driver/mpu/sh/sh7305/tmu | add internal driver primitives <> include/vhex/keyboard | add getkey* (high-level) API | add key event API | add key status API | add keycode information | add keyboard driver interface @update <> include/vhex/driver | add KEYBOARD driver flags <> include/vhex/keyboard | isolate each part of the keyboard module | link the keycache part with the driver-provided keycache information <> src/drivers/mpu/sh/sh7305/keysc | use the new keycache API (high-level interrupt handler) | update keycache API | link the new API in the driver device <> src/drivers/mpu/sh/sh7305/tmu | add timer reservation (WIP) | use a "reservation" cache to known which timer is free instead of hardware | rename internal functions <> src/module/display | Now, by default, DSTACK_CALL() create a pointer on a dstack_call_t | use dsubimage dstack primitive in dimage() @fix <> board/fxcg50/fxcg50.ld | remove the IL-memory and allow only the X-memory area. This because the bootloader uses the IL-memory for DMA transfer and other "low-level" routine used by Gint. Moreover, I originally try to move each "display-driver" in this place, but after some profiling and tests, the dclear()/dupdate() combo went from 9155us up to 33250us (for many reason). So, I keep this area free, but I moved-back from RAM display routines. <> board/fxcg50/initialize | remove "section" copy. This role has been delegated to the bootload (vxBoot) because, in the final ELF file generated by GCC, many relocalization information for the IL/X memory has been set and the bootloader cannot performs general relocalization. So, all "special section/memory" displacement has been moved in the bootloader and we don't have to worrying about the section copy. <> src/drivers/mpu/sh/sh7305/tmu | fix delay calculation in timer reload primitive | disable interruption for profiling timer <> src/module/dislay/ | fix shader index used during the dstack_render() | fix many errors in dimage() shadow render (WIP)
2022-06-24 15:33:36 +02:00
struct vhex_driver *driver = vhex_driver_table();
for (int i = 0; i < vhex_driver_count(); ++i) {
if (driver[i].flags.KEYBOARD) {
memcpy(
&keyboard_info.driver,
driver[i].module_data,
sizeof(struct keyboard_drv_interface)
);
break;
}
}
VxKernel 0.6.0-13 : Add keyboard API + update timer API @add <> include/vhex/driver/mpu/sh/sh7305/keysc | add internal driver primitives <> include/vhex/driver/mpu/sh/sh7305/tmu | add internal driver primitives <> include/vhex/keyboard | add getkey* (high-level) API | add key event API | add key status API | add keycode information | add keyboard driver interface @update <> include/vhex/driver | add KEYBOARD driver flags <> include/vhex/keyboard | isolate each part of the keyboard module | link the keycache part with the driver-provided keycache information <> src/drivers/mpu/sh/sh7305/keysc | use the new keycache API (high-level interrupt handler) | update keycache API | link the new API in the driver device <> src/drivers/mpu/sh/sh7305/tmu | add timer reservation (WIP) | use a "reservation" cache to known which timer is free instead of hardware | rename internal functions <> src/module/display | Now, by default, DSTACK_CALL() create a pointer on a dstack_call_t | use dsubimage dstack primitive in dimage() @fix <> board/fxcg50/fxcg50.ld | remove the IL-memory and allow only the X-memory area. This because the bootloader uses the IL-memory for DMA transfer and other "low-level" routine used by Gint. Moreover, I originally try to move each "display-driver" in this place, but after some profiling and tests, the dclear()/dupdate() combo went from 9155us up to 33250us (for many reason). So, I keep this area free, but I moved-back from RAM display routines. <> board/fxcg50/initialize | remove "section" copy. This role has been delegated to the bootload (vxBoot) because, in the final ELF file generated by GCC, many relocalization information for the IL/X memory has been set and the bootloader cannot performs general relocalization. So, all "special section/memory" displacement has been moved in the bootloader and we don't have to worrying about the section copy. <> src/drivers/mpu/sh/sh7305/tmu | fix delay calculation in timer reload primitive | disable interruption for profiling timer <> src/module/dislay/ | fix shader index used during the dstack_render() | fix many errors in dimage() shadow render (WIP)
2022-06-24 15:33:36 +02:00
if (keyboard_info.driver.keycache_init != NULL)
keyboard_info.driver.keycache_init();
}
VxKernel 0.6.0-13 : Add keyboard API + update timer API @add <> include/vhex/driver/mpu/sh/sh7305/keysc | add internal driver primitives <> include/vhex/driver/mpu/sh/sh7305/tmu | add internal driver primitives <> include/vhex/keyboard | add getkey* (high-level) API | add key event API | add key status API | add keycode information | add keyboard driver interface @update <> include/vhex/driver | add KEYBOARD driver flags <> include/vhex/keyboard | isolate each part of the keyboard module | link the keycache part with the driver-provided keycache information <> src/drivers/mpu/sh/sh7305/keysc | use the new keycache API (high-level interrupt handler) | update keycache API | link the new API in the driver device <> src/drivers/mpu/sh/sh7305/tmu | add timer reservation (WIP) | use a "reservation" cache to known which timer is free instead of hardware | rename internal functions <> src/module/display | Now, by default, DSTACK_CALL() create a pointer on a dstack_call_t | use dsubimage dstack primitive in dimage() @fix <> board/fxcg50/fxcg50.ld | remove the IL-memory and allow only the X-memory area. This because the bootloader uses the IL-memory for DMA transfer and other "low-level" routine used by Gint. Moreover, I originally try to move each "display-driver" in this place, but after some profiling and tests, the dclear()/dupdate() combo went from 9155us up to 33250us (for many reason). So, I keep this area free, but I moved-back from RAM display routines. <> board/fxcg50/initialize | remove "section" copy. This role has been delegated to the bootload (vxBoot) because, in the final ELF file generated by GCC, many relocalization information for the IL/X memory has been set and the bootloader cannot performs general relocalization. So, all "special section/memory" displacement has been moved in the bootloader and we don't have to worrying about the section copy. <> src/drivers/mpu/sh/sh7305/tmu | fix delay calculation in timer reload primitive | disable interruption for profiling timer <> src/module/dislay/ | fix shader index used during the dstack_render() | fix many errors in dimage() shadow render (WIP)
2022-06-24 15:33:36 +02:00
/* keycache_init() : keycache descructor */
void keycache_quit(void)
{
VxKernel 0.6.0-13 : Add keyboard API + update timer API @add <> include/vhex/driver/mpu/sh/sh7305/keysc | add internal driver primitives <> include/vhex/driver/mpu/sh/sh7305/tmu | add internal driver primitives <> include/vhex/keyboard | add getkey* (high-level) API | add key event API | add key status API | add keycode information | add keyboard driver interface @update <> include/vhex/driver | add KEYBOARD driver flags <> include/vhex/keyboard | isolate each part of the keyboard module | link the keycache part with the driver-provided keycache information <> src/drivers/mpu/sh/sh7305/keysc | use the new keycache API (high-level interrupt handler) | update keycache API | link the new API in the driver device <> src/drivers/mpu/sh/sh7305/tmu | add timer reservation (WIP) | use a "reservation" cache to known which timer is free instead of hardware | rename internal functions <> src/module/display | Now, by default, DSTACK_CALL() create a pointer on a dstack_call_t | use dsubimage dstack primitive in dimage() @fix <> board/fxcg50/fxcg50.ld | remove the IL-memory and allow only the X-memory area. This because the bootloader uses the IL-memory for DMA transfer and other "low-level" routine used by Gint. Moreover, I originally try to move each "display-driver" in this place, but after some profiling and tests, the dclear()/dupdate() combo went from 9155us up to 33250us (for many reason). So, I keep this area free, but I moved-back from RAM display routines. <> board/fxcg50/initialize | remove "section" copy. This role has been delegated to the bootload (vxBoot) because, in the final ELF file generated by GCC, many relocalization information for the IL/X memory has been set and the bootloader cannot performs general relocalization. So, all "special section/memory" displacement has been moved in the bootloader and we don't have to worrying about the section copy. <> src/drivers/mpu/sh/sh7305/tmu | fix delay calculation in timer reload primitive | disable interruption for profiling timer <> src/module/dislay/ | fix shader index used during the dstack_render() | fix many errors in dimage() shadow render (WIP)
2022-06-24 15:33:36 +02:00
if (keyboard_info.driver.keycache_quit != NULL)
keyboard_info.driver.keycache_quit();
}
//---
// Public API
//---
VxKernel 0.6.0-13 : Add keyboard API + update timer API @add <> include/vhex/driver/mpu/sh/sh7305/keysc | add internal driver primitives <> include/vhex/driver/mpu/sh/sh7305/tmu | add internal driver primitives <> include/vhex/keyboard | add getkey* (high-level) API | add key event API | add key status API | add keycode information | add keyboard driver interface @update <> include/vhex/driver | add KEYBOARD driver flags <> include/vhex/keyboard | isolate each part of the keyboard module | link the keycache part with the driver-provided keycache information <> src/drivers/mpu/sh/sh7305/keysc | use the new keycache API (high-level interrupt handler) | update keycache API | link the new API in the driver device <> src/drivers/mpu/sh/sh7305/tmu | add timer reservation (WIP) | use a "reservation" cache to known which timer is free instead of hardware | rename internal functions <> src/module/display | Now, by default, DSTACK_CALL() create a pointer on a dstack_call_t | use dsubimage dstack primitive in dimage() @fix <> board/fxcg50/fxcg50.ld | remove the IL-memory and allow only the X-memory area. This because the bootloader uses the IL-memory for DMA transfer and other "low-level" routine used by Gint. Moreover, I originally try to move each "display-driver" in this place, but after some profiling and tests, the dclear()/dupdate() combo went from 9155us up to 33250us (for many reason). So, I keep this area free, but I moved-back from RAM display routines. <> board/fxcg50/initialize | remove "section" copy. This role has been delegated to the bootload (vxBoot) because, in the final ELF file generated by GCC, many relocalization information for the IL/X memory has been set and the bootloader cannot performs general relocalization. So, all "special section/memory" displacement has been moved in the bootloader and we don't have to worrying about the section copy. <> src/drivers/mpu/sh/sh7305/tmu | fix delay calculation in timer reload primitive | disable interruption for profiling timer <> src/module/dislay/ | fix shader index used during the dstack_render() | fix many errors in dimage() shadow render (WIP)
2022-06-24 15:33:36 +02:00
/* keycache_keydown() : check the current key state */
int keycache_keydown(key_t key)
{
VxKernel 0.6.0-13 : Add keyboard API + update timer API @add <> include/vhex/driver/mpu/sh/sh7305/keysc | add internal driver primitives <> include/vhex/driver/mpu/sh/sh7305/tmu | add internal driver primitives <> include/vhex/keyboard | add getkey* (high-level) API | add key event API | add key status API | add keycode information | add keyboard driver interface @update <> include/vhex/driver | add KEYBOARD driver flags <> include/vhex/keyboard | isolate each part of the keyboard module | link the keycache part with the driver-provided keycache information <> src/drivers/mpu/sh/sh7305/keysc | use the new keycache API (high-level interrupt handler) | update keycache API | link the new API in the driver device <> src/drivers/mpu/sh/sh7305/tmu | add timer reservation (WIP) | use a "reservation" cache to known which timer is free instead of hardware | rename internal functions <> src/module/display | Now, by default, DSTACK_CALL() create a pointer on a dstack_call_t | use dsubimage dstack primitive in dimage() @fix <> board/fxcg50/fxcg50.ld | remove the IL-memory and allow only the X-memory area. This because the bootloader uses the IL-memory for DMA transfer and other "low-level" routine used by Gint. Moreover, I originally try to move each "display-driver" in this place, but after some profiling and tests, the dclear()/dupdate() combo went from 9155us up to 33250us (for many reason). So, I keep this area free, but I moved-back from RAM display routines. <> board/fxcg50/initialize | remove "section" copy. This role has been delegated to the bootload (vxBoot) because, in the final ELF file generated by GCC, many relocalization information for the IL/X memory has been set and the bootloader cannot performs general relocalization. So, all "special section/memory" displacement has been moved in the bootloader and we don't have to worrying about the section copy. <> src/drivers/mpu/sh/sh7305/tmu | fix delay calculation in timer reload primitive | disable interruption for profiling timer <> src/module/dislay/ | fix shader index used during the dstack_render() | fix many errors in dimage() shadow render (WIP)
2022-06-24 15:33:36 +02:00
if (keyboard_info.driver.keycache_keydown != NULL)
return keyboard_info.driver.keycache_keydown(key);
return -1;
}
VxKernel 0.6.0-13 : Add keyboard API + update timer API @add <> include/vhex/driver/mpu/sh/sh7305/keysc | add internal driver primitives <> include/vhex/driver/mpu/sh/sh7305/tmu | add internal driver primitives <> include/vhex/keyboard | add getkey* (high-level) API | add key event API | add key status API | add keycode information | add keyboard driver interface @update <> include/vhex/driver | add KEYBOARD driver flags <> include/vhex/keyboard | isolate each part of the keyboard module | link the keycache part with the driver-provided keycache information <> src/drivers/mpu/sh/sh7305/keysc | use the new keycache API (high-level interrupt handler) | update keycache API | link the new API in the driver device <> src/drivers/mpu/sh/sh7305/tmu | add timer reservation (WIP) | use a "reservation" cache to known which timer is free instead of hardware | rename internal functions <> src/module/display | Now, by default, DSTACK_CALL() create a pointer on a dstack_call_t | use dsubimage dstack primitive in dimage() @fix <> board/fxcg50/fxcg50.ld | remove the IL-memory and allow only the X-memory area. This because the bootloader uses the IL-memory for DMA transfer and other "low-level" routine used by Gint. Moreover, I originally try to move each "display-driver" in this place, but after some profiling and tests, the dclear()/dupdate() combo went from 9155us up to 33250us (for many reason). So, I keep this area free, but I moved-back from RAM display routines. <> board/fxcg50/initialize | remove "section" copy. This role has been delegated to the bootload (vxBoot) because, in the final ELF file generated by GCC, many relocalization information for the IL/X memory has been set and the bootloader cannot performs general relocalization. So, all "special section/memory" displacement has been moved in the bootloader and we don't have to worrying about the section copy. <> src/drivers/mpu/sh/sh7305/tmu | fix delay calculation in timer reload primitive | disable interruption for profiling timer <> src/module/dislay/ | fix shader index used during the dstack_render() | fix many errors in dimage() shadow render (WIP)
2022-06-24 15:33:36 +02:00
/* keycache_event_wait() : wait until the next event or the timeout != 0 */
void keycache_event_wait(key_event_t *event, volatile int *timeout)
{
VxKernel 0.6.0-13 : Add keyboard API + update timer API @add <> include/vhex/driver/mpu/sh/sh7305/keysc | add internal driver primitives <> include/vhex/driver/mpu/sh/sh7305/tmu | add internal driver primitives <> include/vhex/keyboard | add getkey* (high-level) API | add key event API | add key status API | add keycode information | add keyboard driver interface @update <> include/vhex/driver | add KEYBOARD driver flags <> include/vhex/keyboard | isolate each part of the keyboard module | link the keycache part with the driver-provided keycache information <> src/drivers/mpu/sh/sh7305/keysc | use the new keycache API (high-level interrupt handler) | update keycache API | link the new API in the driver device <> src/drivers/mpu/sh/sh7305/tmu | add timer reservation (WIP) | use a "reservation" cache to known which timer is free instead of hardware | rename internal functions <> src/module/display | Now, by default, DSTACK_CALL() create a pointer on a dstack_call_t | use dsubimage dstack primitive in dimage() @fix <> board/fxcg50/fxcg50.ld | remove the IL-memory and allow only the X-memory area. This because the bootloader uses the IL-memory for DMA transfer and other "low-level" routine used by Gint. Moreover, I originally try to move each "display-driver" in this place, but after some profiling and tests, the dclear()/dupdate() combo went from 9155us up to 33250us (for many reason). So, I keep this area free, but I moved-back from RAM display routines. <> board/fxcg50/initialize | remove "section" copy. This role has been delegated to the bootload (vxBoot) because, in the final ELF file generated by GCC, many relocalization information for the IL/X memory has been set and the bootloader cannot performs general relocalization. So, all "special section/memory" displacement has been moved in the bootloader and we don't have to worrying about the section copy. <> src/drivers/mpu/sh/sh7305/tmu | fix delay calculation in timer reload primitive | disable interruption for profiling timer <> src/module/dislay/ | fix shader index used during the dstack_render() | fix many errors in dimage() shadow render (WIP)
2022-06-24 15:33:36 +02:00
if (keyboard_info.driver.keycache_event_wait != NULL)
keyboard_info.driver.keycache_event_wait(event, timeout);
}
VxKernel 0.6.0-13 : Add keyboard API + update timer API @add <> include/vhex/driver/mpu/sh/sh7305/keysc | add internal driver primitives <> include/vhex/driver/mpu/sh/sh7305/tmu | add internal driver primitives <> include/vhex/keyboard | add getkey* (high-level) API | add key event API | add key status API | add keycode information | add keyboard driver interface @update <> include/vhex/driver | add KEYBOARD driver flags <> include/vhex/keyboard | isolate each part of the keyboard module | link the keycache part with the driver-provided keycache information <> src/drivers/mpu/sh/sh7305/keysc | use the new keycache API (high-level interrupt handler) | update keycache API | link the new API in the driver device <> src/drivers/mpu/sh/sh7305/tmu | add timer reservation (WIP) | use a "reservation" cache to known which timer is free instead of hardware | rename internal functions <> src/module/display | Now, by default, DSTACK_CALL() create a pointer on a dstack_call_t | use dsubimage dstack primitive in dimage() @fix <> board/fxcg50/fxcg50.ld | remove the IL-memory and allow only the X-memory area. This because the bootloader uses the IL-memory for DMA transfer and other "low-level" routine used by Gint. Moreover, I originally try to move each "display-driver" in this place, but after some profiling and tests, the dclear()/dupdate() combo went from 9155us up to 33250us (for many reason). So, I keep this area free, but I moved-back from RAM display routines. <> board/fxcg50/initialize | remove "section" copy. This role has been delegated to the bootload (vxBoot) because, in the final ELF file generated by GCC, many relocalization information for the IL/X memory has been set and the bootloader cannot performs general relocalization. So, all "special section/memory" displacement has been moved in the bootloader and we don't have to worrying about the section copy. <> src/drivers/mpu/sh/sh7305/tmu | fix delay calculation in timer reload primitive | disable interruption for profiling timer <> src/module/dislay/ | fix shader index used during the dstack_render() | fix many errors in dimage() shadow render (WIP)
2022-06-24 15:33:36 +02:00
/* keycache_event_pop() : pop the first key event in the cache */
void keycache_event_pop(key_event_t * event)
{
if (keyboard_info.driver.keycache_event_pop != NULL)
keyboard_info.driver.keycache_event_pop(event);
}
VxKernel 0.6.0-13 : Add keyboard API + update timer API @add <> include/vhex/driver/mpu/sh/sh7305/keysc | add internal driver primitives <> include/vhex/driver/mpu/sh/sh7305/tmu | add internal driver primitives <> include/vhex/keyboard | add getkey* (high-level) API | add key event API | add key status API | add keycode information | add keyboard driver interface @update <> include/vhex/driver | add KEYBOARD driver flags <> include/vhex/keyboard | isolate each part of the keyboard module | link the keycache part with the driver-provided keycache information <> src/drivers/mpu/sh/sh7305/keysc | use the new keycache API (high-level interrupt handler) | update keycache API | link the new API in the driver device <> src/drivers/mpu/sh/sh7305/tmu | add timer reservation (WIP) | use a "reservation" cache to known which timer is free instead of hardware | rename internal functions <> src/module/display | Now, by default, DSTACK_CALL() create a pointer on a dstack_call_t | use dsubimage dstack primitive in dimage() @fix <> board/fxcg50/fxcg50.ld | remove the IL-memory and allow only the X-memory area. This because the bootloader uses the IL-memory for DMA transfer and other "low-level" routine used by Gint. Moreover, I originally try to move each "display-driver" in this place, but after some profiling and tests, the dclear()/dupdate() combo went from 9155us up to 33250us (for many reason). So, I keep this area free, but I moved-back from RAM display routines. <> board/fxcg50/initialize | remove "section" copy. This role has been delegated to the bootload (vxBoot) because, in the final ELF file generated by GCC, many relocalization information for the IL/X memory has been set and the bootloader cannot performs general relocalization. So, all "special section/memory" displacement has been moved in the bootloader and we don't have to worrying about the section copy. <> src/drivers/mpu/sh/sh7305/tmu | fix delay calculation in timer reload primitive | disable interruption for profiling timer <> src/module/dislay/ | fix shader index used during the dstack_render() | fix many errors in dimage() shadow render (WIP)
2022-06-24 15:33:36 +02:00
/* keycache_event_push() : push a key event in the cache */
void keycache_event_push(key_event_t * event)
{
if (keyboard_info.driver.keycache_event_push != NULL)
keyboard_info.driver.keycache_event_push(event);
}