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

Make configuration easier by including user_config.h #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
15 changes: 13 additions & 2 deletions pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@

/* Set the following three defines to your needs */

#include "user_config.h"

#ifndef SDK_PWM_PERIOD_COMPAT_MODE
#define SDK_PWM_PERIOD_COMPAT_MODE 0
#endif
#ifndef PWM_MAX_CHANNELS
#define PWM_MAX_CHANNELS 8
#endif
#define PWM_DEBUG 0
#define PWM_USE_NMI 0
#ifndef PWM_DEBUG
#define PWM_DEBUG 0
#endif
#ifndef PWM_USE_NMI
#define PWM_USE_NMI 0
#endif

/* no user servicable parts beyond this point */

Expand All @@ -47,6 +53,11 @@
#include <eagle_soc.h>
#include <ets_sys.h>

// ICACHE_RAM_ATTR is neither used nor defined in Non-OS SDK
#ifndef ICACHE_RAM_ATTR
#define ICACHE_RAM_ATTR
#endif

// from SDK hw_timer.c
#define TIMER1_DIVIDE_BY_16 0x0004
#define TIMER1_ENABLE_TIMER 0x0080
Expand Down