Changeset ac307b2 in mainline for uspace/srv/hid/output/port/chardev.c


Ignore:
Timestamp:
2017-11-25T11:12:23Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
98cb5e0d
Parents:
f571ca49 (diff), 0851a3d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into callcaps

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/output/port/chardev.c

    rf571ca49 rac307b2  
    3030 */
    3131
     32#include <async.h>
     33#include <config.h>
     34#include <errno.h>
     35#include <fibril_synch.h>
     36#include <io/chardev.h>
     37#include <loc.h>
    3238#include <stddef.h>
    3339#include <stdint.h>
    34 #include <char_dev_iface.h>
    3540#include <stdio.h>
    3641#include <stdlib.h>
    37 #include <async.h>
    38 #include <fibril_synch.h>
    39 #include <loc.h>
    40 #include <errno.h>
    4142#include <str.h>
    42 #include <config.h>
    4343#include "../ctl/serial.h"
    4444#include "../output.h"
     
    4848
    4949static async_sess_t *sess;
     50static chardev_t *chardev;
    5051static service_id_t serial_cat_id;
    5152
     
    5758{
    5859        uint8_t byte = (uint8_t) ch;
    59         char_dev_write(sess, &byte, 1);
     60        size_t nwr;
     61        chardev_write(chardev, &byte, 1, &nwr);
     62        /* XXX Handle error */
    6063}
    6164
    6265static void chardev_control_puts(const char *str)
    6366{
    64         char_dev_write(sess, (void *) str, str_size(str));
     67        size_t nwr;
     68        chardev_write(chardev, (void *) str, str_size(str), &nwr);
     69        /* XXX Handle error */
    6570}
    6671
     
    126131                return;
    127132        }
     133
     134        rc = chardev_open(sess, &chardev);
     135        if (rc != EOK) {
     136                fibril_mutex_unlock(&discovery_lock);
     137                printf("%s: Failed opening character device\n", NAME);
     138                return;
     139        }
     140
    128141        serial_init(chardev_putchar, chardev_control_puts);
    129142
Note: See TracChangeset for help on using the changeset viewer.