Changeset 5906:006573352519 in roaraudio


Ignore:
Timestamp:
06/17/13 11:45:59 (6 years ago)
Author:
phi
Branch:
default
Message:

updated protocol support to support /banks/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/roard/dmx-i2c.c

    r5905 r5906  
    3333 
    3434#define ADDR_COMMAND   2 
    35 #define ADDR_DATA      4 
     35#define ADDR_BANK      4 
     36#define ADDR_DATA      5 
    3637 
    3738#define COMMAND_DMX    0x3f 
     
    7475 
    7576static inline int __i2c_set_channel(size_t channel, uint8_t value) { 
    76  return __i2c_write(ADDR_DATA+channel, value); 
     77 size_t bank, offset; 
     78 
     79 bank = channel/32; 
     80 offset = bank*32; 
     81 
     82 if ( __i2c_write(ADDR_BANK, bank) == -1 ) 
     83  return -1; 
     84 
     85 return __i2c_write(ADDR_DATA+channel-offset, value); 
    7786} 
    7887 
Note: See TracChangeset for help on using the changeset viewer.