Wrap DMA channel count after incrementing

This commit is contained in:
Ernest Wong 2017-11-19 18:20:18 +13:00 committed by Fabian
parent 7581a4af5b
commit 9f75c81e00

View file

@ -312,7 +312,7 @@ DMA.prototype.do_read = function(buffer, start, len, channel, fn)
// start and len in bytes
DMA.prototype.do_write = function(buffer, start, len, channel, fn)
{
var read_count = this.channel_count[channel] + 1,
var read_count = (this.channel_count[channel] + 1) & 0xFFFF,
read_bytes = read_count,
addr = this.address_get_8bit(channel),
unfinished = false,