Changeset b06d0552 in rtems


Ignore:
Timestamp:
Sep 8, 2008, 9:52:49 AM (11 years ago)
Author:
Thomas Doerfler <Thomas.Doerfler@…>
Branches:
4.10, 4.11, 4.9, master
Children:
95c274e
Parents:
4a260f0
Message:

corrected parameters inside i2c driver for done signalling

Location:
c/src/lib/libbsp/m68k/mcf5206elite
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/mcf5206elite/ChangeLog

    r4a260f0 rb06d0552  
     12008-09-08      Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
     2
     3        * i2c/i2c.c, i2c/i2cdrv.c, include/i2c.h:
     4        converted done_arg to a void pointer
     5       
    162008-09-06      Ralf Corsépius <ralf.corsepius@rtems.org>
    27
  • c/src/lib/libbsp/m68k/mcf5206elite/i2c/i2c.c

    r4a260f0 rb06d0552  
    2424 */
    2525static void
    26 i2c_transfer_sema_done_func(uint32_t        arg)
    27 {
    28     rtems_id sema = (rtems_id)arg;
     26i2c_transfer_sema_done_func(void * arg)
     27{
     28    rtems_id sema = *(rtems_id *)arg;
    2929    rtems_semaphore_release(sema);
    3030}
     
    3939 */
    4040static void
    41 i2c_transfer_poll_done_func(uint32_t         arg)
     41i2c_transfer_poll_done_func(void *arg)
    4242{
    4343    bool *poll_done_flag = (bool *)arg;
     
    7373    if (sc != RTEMS_SUCCESSFUL)
    7474        return I2C_RESOURCE_NOT_AVAILABLE;
    75     sc = i2c_transfer(bus, nmsg, msg, i2c_transfer_sema_done_func, sema);
     75    sc = i2c_transfer(bus, nmsg, msg,
     76                      i2c_transfer_sema_done_func, &sema);
    7677    if (sc != RTEMS_SUCCESSFUL)
    7778    {
     
    99100i2c_transfer_wait_poll(i2c_bus_number bus, i2c_message *msg, int nmsg)
    100101{
     102  /*
     103   * this looks nasty, but is correct:
     104   * we wait in this function, until the poll_done_flag is
     105   * set deep inside the i2c_poll() function
     106   */
    101107    volatile bool poll_done_flag;
    102108    rtems_status_code sc;
    103109    poll_done_flag = false;
    104     sc = i2c_transfer(bus, nmsg, msg, i2c_transfer_poll_done_func,
    105                       (uint32_t)&poll_done_flag);
     110    sc = i2c_transfer(bus, nmsg, msg,
     111                      i2c_transfer_poll_done_func,(void *)&poll_done_flag);
    106112    if (sc != RTEMS_SUCCESSFUL)
    107113        return sc;
  • c/src/lib/libbsp/m68k/mcf5206elite/i2c/i2cdrv.c

    r4a260f0 rb06d0552  
    5050    int               nmsg;     /* number of messages in transfer */
    5151    i2c_transfer_done done;     /* transfer done callback function */
    52     uint32_t          done_arg; /* arbitrary argument to done callback */
     52    void *    done_arg_ptr;     /* arbitrary arg pointer to done callback */
    5353} i2c_qel;
    5454
     
    8585 */
    8686static void
    87 i2cdrv_done(uint32_t         arg)
     87i2cdrv_done(void * arg_ptr)
    8888{
    8989    rtems_interrupt_level level;
    9090    i2c_qel *qel = tqueue + tqueue_tail;
    91     qel->done(qel->done_arg);
     91    qel->done(qel->done_arg_ptr);
    9292    rtems_interrupt_disable(level);
    9393    tqueue_tail = (tqueue_tail + 1) % tqueue_size;
     
    120120            mcfmbus_select_clock_divider(&mbus, i2cdrv_bus_clock_div_current);
    121121        }
    122         sc = mcfmbus_i2c_transfer(&mbus, qel->nmsg, qel->msg, i2cdrv_done,
    123                                   (uint32_t)qel);
     122        sc = mcfmbus_i2c_transfer(&mbus, qel->nmsg, qel->msg,
     123                                  i2cdrv_done,qel);
    124124        if (sc != RTEMS_SUCCESSFUL)
    125125        {
     
    129129                qel->msg[i].status = I2C_RESOURCE_NOT_AVAILABLE;
    130130            }
    131             i2cdrv_done((uint32_t)qel);
     131            i2cdrv_done(qel);
    132132        }
    133133    }
     
    148148 *     msg - pointer to messages array
    149149 *     done - function which is called when transfer is finished
    150  *     done_arg - arbitrary argument passed to done funciton
     150 *     done_arg_ptr - arbitrary argument pointer passed to done funciton
    151151 *
    152152 * RETURNS:
     
    156156rtems_status_code
    157157i2c_transfer(i2c_bus_number bus, int nmsg, i2c_message *msg,
    158              i2c_transfer_done done, uint32_t         done_arg)
     158             i2c_transfer_done done, void *     done_arg_ptr)
    159159{
    160160    i2c_qel qel;
     
    175175    qel.nmsg = nmsg;
    176176    qel.done = done;
    177     qel.done_arg = done_arg;
     177    qel.done_arg_ptr = done_arg_ptr;
    178178    rtems_interrupt_disable(level);
    179179    if ((tqueue_head + 1) % tqueue_size == tqueue_tail)
  • c/src/lib/libbsp/m68k/mcf5206elite/include/i2c.h

    r4a260f0 rb06d0552  
    117117 *     msg - pointer to messages array
    118118 *     done - function which is called when transfer is finished
    119  *     done_arg - arbitrary argument passed to done funciton
     119 *     done_arg_ptr - arbitrary argument ptr passed to done funciton
    120120 *
    121121 * RETURNS:
     
    125125rtems_status_code
    126126i2c_transfer(i2c_bus_number bus, int nmsg, i2c_message *msg,
    127              i2c_transfer_done done, uint32_t         done_arg);
     127             i2c_transfer_done done, void * done_arg_ptr);
    128128
    129129/* i2c_transfer_wait --
Note: See TracChangeset for help on using the changeset viewer.