2
0
mirror of git://git.code.sf.net/p/openocd/code synced 2025-08-16 17:57:47 +10:00

rtt: Fix check for available down-channels

The number of up-channels is erroneously checked instead of the number
of down-channels.

Change-Id: Iff5348387b3466ed66f34df81e1039918608ac77
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8995
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
This commit is contained in:
Marc Schink 2025-07-11 14:39:45 +02:00 committed by Antonio Borneo
parent c8e6746e9f
commit 4d14ac5741

View File

@ -288,7 +288,7 @@ int rtt_set_polling_interval(unsigned int interval)
int rtt_write_channel(unsigned int channel_index, const uint8_t *buffer,
size_t *length)
{
if (channel_index >= rtt.ctrl.num_up_channels) {
if (channel_index >= rtt.ctrl.num_down_channels) {
LOG_WARNING("rtt: Down-channel %u is not available", channel_index);
return ERROR_OK;
}