Changeset c145bc2 in mainline


Ignore:
Timestamp:
2009-08-09T15:19:54Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e795203
Parents:
330965c
Message:

Updating keyboard LEDs.

Location:
uspace/srv/kbd
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/kbd/ctl/gxe_fb.c

    r330965c rc145bc2  
    225225}
    226226
     227void kbd_ctl_set_ind(unsigned mods)
     228{
     229        (void) mods;
     230}
     231
    227232/**
    228233 * @}
  • uspace/srv/kbd/ctl/pc.c

    r330965c rc145bc2  
    4040#include <io/keycode.h>
    4141#include <kbd_ctl.h>
     42#include <kbd_port.h>
    4243#include <gsp.h>
    4344
     
    4546        ds_s,
    4647        ds_e
     48};
     49
     50enum special_code {
     51        SC_ACK = 0xfa,
     52        SC_NAK = 0xfe
     53};
     54
     55enum lock_ind_bits {
     56        LI_SCROLL       = 0x01,
     57        LI_NUM          = 0x02,
     58        LI_CAPS         = 0x04
     59};
     60
     61enum kbd_command {
     62        KBD_CMD_SET_LEDS = 0xed
    4763};
    4864
     
    194210        size_t map_length;
    195211
     212        /*
     213         * ACK/NAK are returned as response to us sending a command.
     214         * We are not interested in them.
     215         */
     216        if (scancode == SC_ACK || scancode == SC_NAK)
     217                return;
     218
    196219        if (scancode == 0xe0) {
    197220                ds = ds_e;
     
    230253}
    231254
     255void kbd_ctl_set_ind(unsigned mods)
     256{
     257        uint8_t b;
     258
     259        b = 0;
     260        if ((mods & KM_CAPS_LOCK) != 0)
     261                b = b | LI_CAPS;
     262        if ((mods & KM_NUM_LOCK) != 0)
     263                b = b | LI_NUM;
     264        if ((mods & KM_SCROLL_LOCK) != 0)
     265                b = b | LI_SCROLL;
     266
     267        kbd_port_write(KBD_CMD_SET_LEDS);
     268        kbd_port_write(b);
     269}
     270
    232271/**
    233272 * @}
  • uspace/srv/kbd/ctl/pl050.c

    r330965c rc145bc2  
    258258}
    259259
     260void kbd_ctl_set_ind(unsigned mods)
     261{
     262        (void) mods;
     263}
     264
    260265/**
    261266 * @}
  • uspace/srv/kbd/ctl/stty.c

    r330965c rc145bc2  
    224224}
    225225
     226void kbd_ctl_set_ind(unsigned mods)
     227{
     228        (void) mods;
     229}
     230
    226231/**
    227232 * @}
  • uspace/srv/kbd/ctl/sun.c

    r330965c rc145bc2  
    7272        if (key != 0)
    7373                kbd_push_ev(type, key);
     74}
     75
     76void kbd_ctl_set_ind(unsigned mods)
     77{
     78        (void) mods;
    7479}
    7580
  • uspace/srv/kbd/generic/kbd.c

    r330965c rc145bc2  
    125125                        mods = mods ^ (mod_mask & ~lock_keys);
    126126                        lock_keys = lock_keys | mod_mask;
     127
     128                        /* Update keyboard lock indicator lights. */
     129                        kbd_ctl_set_ind(mods);
    127130                } else {
    128131                        lock_keys = lock_keys & ~mod_mask;
  • uspace/srv/kbd/include/kbd_ctl.h

    r330965c rc145bc2  
    4040extern void kbd_ctl_parse_scancode(int);
    4141extern int kbd_ctl_init(void);
    42 
     42extern void kbd_ctl_set_ind(unsigned);
    4343
    4444#endif
  • uspace/srv/kbd/include/kbd_port.h

    r330965c rc145bc2  
    3838#define KBD_PORT_H_
    3939
     40#include <sys/types.h>
     41
    4042extern int kbd_port_init(void);
    4143extern void kbd_port_yield(void);
    4244extern void kbd_port_reclaim(void);
     45extern void kbd_port_write(uint8_t);
    4346
    4447#endif
  • uspace/srv/kbd/port/dummy.c

    r330965c rc145bc2  
    5151}
    5252
     53void kbd_port_write(uint8_t data)
     54{
     55        (void) data;
     56}
     57
    5358/** @}
    5459*/
  • uspace/srv/kbd/port/gxemul.c

    r330965c rc145bc2  
    7878}
    7979
     80void kbd_port_write(uint8_t data)
     81{
     82        (void) data;
     83}
     84
    8085/** Process data sent when a key is pressed.
    8186 * 
  • uspace/srv/kbd/port/i8042.c

    r330965c rc145bc2  
    160160}
    161161
     162void kbd_port_write(uint8_t data)
     163{
     164        pio_write_8(&i8042->data, data);
     165        wait_ready();
     166}
     167
    162168static void i8042_irq_handler(ipc_callid_t iid, ipc_call_t *call)
    163169{
  • uspace/srv/kbd/port/msim.c

    r330965c rc145bc2  
    7878}
    7979
     80void kbd_port_write(uint8_t data)
     81{
     82        (void) data;
     83}
     84
    8085static void msim_irq_handler(ipc_callid_t iid, ipc_call_t *call)
    8186{
  • uspace/srv/kbd/port/pl050.c

    r330965c rc145bc2  
    102102}
    103103
     104void kbd_port_write(uint8_t data)
     105{
     106        (void) data;
     107}
     108
    104109static void pl050_irq_handler(ipc_callid_t iid, ipc_call_t *call)
    105110{
  • uspace/srv/kbd/port/sgcn.c

    r330965c rc145bc2  
    133133}
    134134
     135void kbd_port_write(uint8_t data)
     136{
     137        (void) data;
     138}
     139
    135140/**
    136141 * Handler of the "key pressed" event. Reads codes of all the pressed keys from
  • uspace/srv/kbd/port/ski.c

    r330965c rc145bc2  
    7878}
    7979
     80void kbd_port_write(uint8_t data)
     81{
     82        (void) data;
     83}
     84
    8085/** Thread to poll Ski for keypresses. */
    8186static void *ski_thread_impl(void *arg)
  • uspace/srv/kbd/port/sun.c

    r330965c rc145bc2  
    7171}
    7272
     73void kbd_port_write(uint8_t data)
     74{
     75        (void) data;
     76}
     77
    7378/** @}
    7479*/
Note: See TracChangeset for help on using the changeset viewer.