Skip to content

Add API to set ticker IRQ handler. #5369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 1, 2017

Conversation

mprse
Copy link
Contributor

@mprse mprse commented Oct 24, 2017

Cherry-picking from #5234, going to master

cc @c1728p9 @0xc0170

Description

Add API to set IRQ handler for high frequency ticker and low power ticker.
This is done to be able to test HAL ticker API without using mbed upper layers to connect IRQ handler.

Status

READY

Migrations

YES
Add API to set IRQ handler for high frequency ticker and low power ticker.
Original IRQ handler is set as default ticker IRQ handler which should be used by all targets.

Related PRs

------ | ------
ARMmbed:feature-hal-spec-ticker | #5233

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

I would like to have here the reason for this API, as it is part of HAL, if I am porting, I would probably implement this without knowing that there is default implementation. As I understand this API is used primary for tests, any target should use default application.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 24, 2017

Labeled for 5.7.0 , new API addition

@bulislaw
Copy link
Member

Good point, @mprse could you add comment that it's primarily for testing purposes and it's not required part of HAL implementation.

@mprse mprse force-pushed the ticker_irq_handler_set branch from eaac822 to 05a5baf Compare October 27, 2017 13:19
@mprse
Copy link
Contributor Author

mprse commented Oct 27, 2017

@0xc0170 @bulislaw
Added the following note in the description:

this function is primarily for testing purposes and it's not required part of HAL implementation

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

The commit msg can provide more information about the change (why this is being added, how to use new API in this case), would help all of us

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 27, 2017

/morph build

This API is added primarily for testing purposes, to be able to test HAL drivers without using upper layers to handle ticker interrupt.
By default IRQ handler is set to ticker_irq_handler() for us ticker and lp ticker - original one.

Usage example (setting custom ticker irq handler):

void my_irq_handler(const ticker_data_t *const) {
 // handle interrupt
}

ticker_irq_handler_type old_handler = set_us_ticker_irq_handler(my_irq_handler);

Respectively for lp timer set_lp_ticker_irq_handler() API should be used.
@mprse mprse force-pushed the ticker_irq_handler_set branch from 05a5baf to 5da5b28 Compare October 30, 2017 10:28
@mprse
Copy link
Contributor Author

mprse commented Oct 30, 2017

The commit msg can provide more information about the change (why this is being added, how to use new API in this case), would help all of us'

Commit message has been updated as requested.

@studavekar
Copy link
Contributor

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 30, 2017

Build : SUCCESS

Build number : 370
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5369/

Triggering tests

/morph test
/morph uvisor-test

@mbed-ci
Copy link

mbed-ci commented Oct 30, 2017

@theotherjimmy theotherjimmy merged commit bfcb173 into ARMmbed:master Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants