[PATCH] AVR EXT Topic is solved

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

Moderators: utzig, tfAteba

Marco
Posts: 128
Joined: Tue Apr 16, 2013 8:22 pm
Has thanked: 4 times
Been thanked: 11 times

Re: [PATCH] AVR EXT

Postby Marco » Tue Mar 28, 2017 2:50 pm

Hi all,

I took igor's patch and moved forward from there. I have a first patch (against trunk) you can try. I tested the PCINT interrupts on an ATmega162 and it seems to work. I tried to support the ATmega328P and ATmega2560 as well but i can't test them. Maybe someone else can try this?

1) The driver now supports PCINT interrupts as if it is a normal INT interrupt. You don't have to check which bits have been changed in the PCINT interrupt handler. Instead, each PCINT pin has its own callback function so the source of the interrupt (INT or PCINT) is hidden from the user.

2) Unused INTs and PCINTs can be disabled in mcuconf. By default, all INTs and PCINTs are disabled. Set AVR_EXT_USE_INTx or AVR_EXT_USE_PCINTx to TRUE in mcuconf.h to overrule the defaults. This can save some memory if you have some unused INTs or PCINT ports.

3) EXT_CH_MODE_AUTOSTART is now also supported for PCINTs.

4) PCINT channel enable/disable is now working properly.

Let me know if you have any problems testing the driver.

Marco
Attachments
avr_ext.zip
PCINT support for EXT
(6.51 KiB) Downloaded 59 times

User avatar
tfAteba
Posts: 526
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 80 times
Been thanked: 46 times

Re: [PATCH] AVR EXT

Postby tfAteba » Tue Mar 28, 2017 9:21 pm

Hi Macro,

Thanks for your work and you feedback for the PCINT driver.

Marco wrote:
I tested the PCINT interrupts on an ATmega162 and it seems to work. I tried to support the ATmega328P and ATmega2560 as well but i can't test them. Maybe someone else can try this?

I'm going to make a test with the two others MCU and see if everything is working fine.

Thanks for your tips on how to use the driver is is very clear :) .

So I will make a feedback as soon as I can.
regards,

Theo.

User avatar
tfAteba
Posts: 526
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 80 times
Been thanked: 46 times

Re: [PATCH] AVR EXT

Postby tfAteba » Sun Apr 02, 2017 9:22 pm

Hi Marco,

I'm running on some trouble when applaying the patch.

Here is what I have:

Code: Select all

patch -p1 < ../../avr_ext.patch
(Stripping trailing CRs from patch; use --binary to disable.)
patching file hal/ports/AVR/avr_pins.h
Hunk #1 FAILED at 91 (different line endings).
1 out of 1 hunk FAILED -- saving rejects to file hal/ports/AVR/avr_pins.h.rej
(Stripping trailing CRs from patch; use --binary to disable.)
patching file hal/ports/AVR/hal_ext_lld.c
Hunk #1 FAILED at 1 (different line endings).
Hunk #2 FAILED at 15 (different line endings).
Hunk #3 FAILED at 30 (different line endings).
Hunk #4 FAILED at 43 (different line endings).
Hunk #5 FAILED at 351 (different line endings).
5 out of 5 hunks FAILED -- saving rejects to file hal/ports/AVR/hal_ext_lld.c.rej
(Stripping trailing CRs from patch; use --binary to disable.)
patching file hal/ports/AVR/hal_ext_lld.h
Hunk #1 FAILED at 1 (different line endings).
Hunk #2 FAILED at 15 (different line endings).
Hunk #3 FAILED at 32 (different line endings).
Hunk #4 FAILED at 81 (different line endings).
Hunk #5 FAILED at 106 (different line endings).
Hunk #6 FAILED at 112 (different line endings).
6 out of 6 hunks FAILED -- saving rejects to file hal/ports/AVR/hal_ext_lld.h.rej


So I get .rej files for all files modify by the patch.

How did you apply your patch ? I have the same problem with the original patch made by Igor.
regards,

Theo.

utzig
Posts: 355
Joined: Sat Jan 07, 2012 6:22 pm
Location: Brazil
Has thanked: 1 time
Been thanked: 19 times
Contact:

Re: [PATCH] AVR EXT

Postby utzig » Sun Apr 02, 2017 9:52 pm

I can only apply Marco's patches on Linux. Get the same errors as you on macOS. Looks like the patches are created from git with a non-standard auto.crlf configuration.

User avatar
tfAteba
Posts: 526
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 80 times
Been thanked: 46 times

Re: [PATCH] AVR EXT

Postby tfAteba » Sun Apr 02, 2017 9:59 pm

Hi Utzig,

I'm on Linux Ubuntu distribution but I can't apply it. Very strange, I'm steal trying if you have an advice, it is welcome ;)
regards,

Theo.

User avatar
tfAteba
Posts: 526
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 80 times
Been thanked: 46 times

Re: [PATCH] AVR EXT

Postby tfAteba » Sun Apr 02, 2017 10:08 pm

Utzig,

So if you are able to apply the patch, can you apply it to the trunk if it look ok for you?

I will then make some tests with the Arduino Mega and Arduino Uno after that.
regards,

Theo.

utzig
Posts: 355
Joined: Sat Jan 07, 2012 6:22 pm
Location: Brazil
Has thanked: 1 time
Been thanked: 19 times
Contact:

Re: [PATCH] AVR EXT

Postby utzig » Sun Apr 02, 2017 11:29 pm

Applied. You can pass --binary to patch on Linux and it takes care of the line endings.

User avatar
tfAteba
Posts: 526
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 80 times
Been thanked: 46 times

Re: [PATCH] AVR EXT

Postby tfAteba » Mon Apr 03, 2017 7:55 am

Thanks for the tips and for applying the patch, I will try this tonight.
regards,

Theo.

Marco
Posts: 128
Joined: Tue Apr 16, 2013 8:22 pm
Has thanked: 4 times
Been thanked: 11 times

Re: [PATCH] AVR EXT

Postby Marco » Mon Apr 03, 2017 10:07 am

utzig wrote:I can only apply Marco's patches on Linux. Get the same errors as you on macOS. Looks like the patches are created from git with a non-standard auto.crlf configuration.


The patch is created using svn, but with files copied from another git repository. Probably that caused the problems with line endings. I'm sorry guys :oops:

I hope that except from the line endings everything is ok

User avatar
tfAteba
Posts: 526
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 80 times
Been thanked: 46 times

Re: [PATCH] AVR EXT

Postby tfAteba » Tue Apr 25, 2017 10:38 pm

Hi all,

I just started to test the PCINTx implementation.

I then needed to update all the AVR/mcuconfig.h file because of alot of warning during the compilation.

Now the compilation of other demo or test file is done with no warning, i will write an application and test the AVR PCINTx part.
regards,

Theo.


Return to “AVR Support”

Who is online

Users browsing this forum: No registered users and 2 guests