Changeset 1973:4e6945223979 in roaraudio for libroarlight


Ignore:
Timestamp:
06/12/09 03:00:22 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

fixed some small bugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroarlight/pwm.c

    r1972 r1973  
    6161 uint64_t        s; 
    6262 
     63 ROAR_DBG("roar_light_pwm_send(state=%p, vio=%p, len=%u) = ?", state, vio, len); 
     64 
    6365 if ( state == NULL ) 
    6466  return -1; 
     
    7072  return -1; 
    7173 
     74 if ( len == 0 ) 
     75  return 0; 
     76 
    7277 if ( (buf = malloc(len)) == NULL ) 
    7378  return -1; 
     
    7681 
    7782 while (todo > 1) { 
     83  ROAR_DBG("roar_light_pwm_send(*): loop: todo=%u, fill=%i", todo, state->fill); 
     84 
    7885  if ( state->fill < 16 ) { 
    79    s          = _g_roar_lpwm16[state->value]; 
    80    s        <<= state->fill; 
    81    state->s  |= s; 
     86   s             = _g_roar_lpwm16[state->value]; 
     87   s           <<= state->fill; 
     88   state->s     |= s; 
     89   state->fill  += 16; 
    8290  } 
    8391 
     
    96104 } 
    97105 
    98  if ( roar_vio_write(vio, buf, len) != len ) { 
     106 if ( roar_vio_basic_write(vio, buf, len) != len ) { 
    99107  free(buf); 
    100108  return -1; 
Note: See TracChangeset for help on using the changeset viewer.