[XMEGA] serial driver build failure Topic is solved

ChibiOS public support forum for topics related to the Atmel AVR family of micro-controllers.

Moderator: tfAteba

Post Reply
Sergio
Posts: 4
Joined: Tue Jan 22, 2019 3:26 pm

[XMEGA] serial driver build failure

Post by Sergio »

Hi!

I've got a warning and build failure (if -Werror is used) for XMEGA hal_serial_lld.c. I think this is obvious semicolon misting bug, error should be propagated if specified flag are set:

OSAL_IRQ_HANDLER(USARTC0_RXC_vect) {
...
if (status & (USART_FERR_bm | USART_PERR_bm | USART_BUFOVF_bm));
set_error(&SD1, status);
...
}
ChibiOS/os/hal/ports/AVR/XMEGA/LLD/USARTv1/hal_serial_lld.c:432:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
utzig
Posts: 359
Joined: Sat Jan 07, 2012 6:22 pm
Has thanked: 1 time
Been thanked: 20 times

Re: [XMEGA] serial driver build failure

Post by utzig »

I think this is an issue with very recent gcc releases, you can fix it by identing the ";" like this:

Code: Select all

if (status & (USART_FERR_bm | USART_PERR_bm | USART_BUFOVF_bm))
    ;
Sergio
Posts: 4
Joined: Tue Jan 22, 2019 3:26 pm

Re: [XMEGA] serial driver build failure

Post by Sergio »

Well , I think it is more than just compiler requirement. I think set_error should be executed if condition succeed
utzig
Posts: 359
Joined: Sat Jan 07, 2012 6:22 pm
Has thanked: 1 time
Been thanked: 20 times

Re: [XMEGA] serial driver build failure

Post by utzig »

Sergio wrote:Well , I think it is more than just compiler requirement. I think set_error should be executed if condition succeed

Oh, you're right, the "set_error" should probably be inside the "if" block. I would suggest sending a patch.
User avatar
tfAteba
Posts: 551
Joined: Fri Oct 16, 2015 11:03 pm
Has thanked: 91 times
Been thanked: 50 times

Re: [XMEGA] serial driver build failure

Post by tfAteba »

Hello Sergio, Utzig,

Thanks for finding this bug.

Yes if you can send a patch to fix the problem I will be happy to apply it.

Note that This driver is still in development and It nice to see that other people are interested on this architecture.
Sergio
Posts: 4
Joined: Tue Jan 22, 2019 3:26 pm

Re: [XMEGA] serial driver build failure

Post by Sergio »

Oh, patch submit procedure is rather complex (in comparison with github process). Is there any plan to switch to more modern hosting?
User avatar
tfAteba
Posts: 551
Joined: Fri Oct 16, 2015 11:03 pm
Has thanked: 91 times
Been thanked: 50 times

Re: [XMEGA] serial driver build failure

Post by tfAteba »

Hello,

I Hope that some day ChobiOS will move to more modern hosting tool like you said, but for the moment we have to follow the way define by Giovanni.

Si you Can generate a patch and just attach it here!
Post Reply