Skip to content
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

Initial version of code to support multiple hardware timers #2497

Merged
merged 3 commits into from
Feb 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/modules/gpio_pulse.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "pin_map.h"
#include "driver/gpio16.h"

#define TIMER_OWNER 'P'
#define TIMER_OWNER (('P' << 8) + 'U')
Copy link
Member Author

Choose a reason for hiding this comment

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

This was one of the problems -- it used the same value as the PWM module.


#define xstr(s) str(s)
#define str(s) #s
Expand Down Expand Up @@ -434,7 +434,7 @@ static int gpio_pulse_start(lua_State *L) {
pulser->next_adjust = initial_adjust;

// Now start things up
if (!platform_hw_timer_init(TIMER_OWNER, FRC1_SOURCE, TRUE)) {
if (!platform_hw_timer_init(TIMER_OWNER, FRC1_SOURCE, FALSE)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know why I used autoload=true when I first wrote the code. It wasn't needed. I did make the new hw_timer stuff work with autoload=true before I switched this over to FALSE.

// Failed to init the timer
luaL_error(L, "Unable to initialize timer");
}
Expand Down
Loading