On Mon, Nov 27, 2017 at 4:14 PM, Hans Verkuil hverkuil@xs4all.nl wrote:
ktime_get_ts(&ts);
use_alternates = ts.tv_sec % 10 >= 5;
timestamp = ktime_sub(ktime_get(), dev->radio_rds_init_time);
blk = ktime_divns(timestamp, VIVID_RDS_NSEC_PER_BLK);
use_alternates = blk % VIVID_RDS_GEN_BLOCKS;
Almost right. This last line should be:
use_alternates = (blk / VIVID_RDS_GEN_BLOCKS) & 1;
With that in place it works and you can add my:
Tested-by: Hans Verkuil hans.verkuil@cisco.com
Makes sense. Sending a fixed version now, thanks a lot for testing!
Arnd