Skip to content

Conversation

@alexmchp
Copy link
Contributor

Added Atmel Studio projects for ATMega4809 and AVR128DA48

Description

Beside the projects there are a couple of changes in Demo/Common files. These changes are:
o (1) In semtest.h I updated the return type of xAreSemaphoreTasksStillRunning function from BaseType_t to portBASE_TYPE because this is the return type it has where it is implemented (semtest.c).
o (2) In recmutex.c I added an explicit cast to UBaseType_t On line 260. I did this because the right-hand expression in the “==” check was, at some point, expected to roll over and therefore be equal to the left-hand side (that was, at that time, 0). Instead, what I think was happening was that the compiler performed integer promotion and turned the 8 bit variable into a 32 bit one, this way roll over did not happened and it was actually comparing 0 to 256 instead of 0 to 255 + 1 (=0 because of roll over).

Test Steps

From what I can tell the above changes should be backwards compatible because: in change (1) the two types actually resolve to the same primitive type and in change (2) the cast actually serves as an additional clarification to the "compiler" about what the code is expected to do.
But you might have a bigger picture than me, and have some more tests to perform in order to confirm the changes are ok, so this is way I described them in detail.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Contributor

@yuhui-zheng yuhui-zheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving a comment for my next commits.

Besides the type update, I'll also apply the P R#2 from private repo. (Which cover register r28,29,31 in regtest.c as well readme.md update.)

#define SEMAPHORE_TEST_H

void vStartSemaphoreTasks( UBaseType_t uxPriority );
BaseType_t xAreSemaphoreTasksStillRunning( void );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this inconsistency.

I may want to update your PR to use BaseType_t in both semtest.{c,h}. Since according to https://www.freertos.org/upgrading-to-FreeRTOS-V8.html, portBASE_TYPE is the old name, and BaseType_t is the new name (since FreeRTOS V8.x.x ).

}

/* The controlling and blocking tasks should be in lock step. */
if( uxControllingCycles != ( uxBlockingCycles + 1 ) )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged. Thanks.

@yuhui-zheng
Copy link
Contributor

Oops... By rebasing, force pushing source branch I accidentally closed the PR and now it won't let me reopen... will figure this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants