Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
c20b4098
Commit
c20b4098
authored
Oct 31, 2016
by
Bob-the-Kuhn
Committed by
Scott Lahteine
Nov 1, 2016
Browse files
Options
Downloads
Patches
Plain Diff
2 bug fixes & some minor changes
see detailed description in PR #5118
parent
fa6bf126
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Marlin/pinsDebug.h
+34
-36
34 additions, 36 deletions
Marlin/pinsDebug.h
with
34 additions
and
36 deletions
Marlin/pinsDebug.h
+
34
−
36
View file @
c20b4098
...
@@ -60,7 +60,7 @@ static bool report_pin_name(int8_t pin, bool &pin_is_analog) {
...
@@ -60,7 +60,7 @@ static bool report_pin_name(int8_t pin, bool &pin_is_analog) {
if
(
pin
==
1
)
{
sprintf
(
buffer
,
NAME_FORMAT
,
"TXD"
);
SERIAL_ECHO
(
buffer
);
return
true
;
}
if
(
pin
==
1
)
{
sprintf
(
buffer
,
NAME_FORMAT
,
"TXD"
);
SERIAL_ECHO
(
buffer
);
return
true
;
}
#endif
#endif
// Pin list updated from 7 OCT RCBugfix branch
// Pin list updated from 7 OCT RCBugfix branch
- max length of pin name is 24
#if defined(__FD) && __FD >= 0
#if defined(__FD) && __FD >= 0
PIN_SAY
(
__FD
)
PIN_SAY
(
__FD
)
#endif
#endif
...
@@ -656,10 +656,10 @@ static bool report_pin_name(int8_t pin, bool &pin_is_analog) {
...
@@ -656,10 +656,10 @@ static bool report_pin_name(int8_t pin, bool &pin_is_analog) {
}
// report_pin_name
}
// report_pin_name
#define PWM_PRINT(V) do{ sprintf(buffer, "PWM: %4d", V); SERIAL_ECHO(buffer); }while(0)
#define PWM_PRINT(V) do{ sprintf(buffer, "PWM: %4d", V); SERIAL_ECHO(buffer); }while(0)
#define PWM_CASE(N) \
#define PWM_CASE(N
,Z
) \
case TIMER##N: \
case TIMER##N
##Z
: \
if (TCCR##N & (_BV(COM##
N
##1) | _BV(COM##
N
##0))) { \
if (TCCR##N
##A
& (_BV(COM##
N##Z
##1) | _BV(COM##
N##Z
##0))) { \
PWM_PRINT(OCR##N); \
PWM_PRINT(OCR##N
##Z
); \
return true; \
return true; \
} else return false
} else return false
...
@@ -667,43 +667,43 @@ static bool report_pin_name(int8_t pin, bool &pin_is_analog) {
...
@@ -667,43 +667,43 @@ static bool report_pin_name(int8_t pin, bool &pin_is_analog) {
* Print a pin's PWM status.
* Print a pin's PWM status.
* Return true if it's currently a PWM pin.
* Return true if it's currently a PWM pin.
*/
*/
static
bool
PWM
_status
(
uint8_t
pin
)
{
static
bool
pwm
_status
(
uint8_t
pin
)
{
char
buffer
[
20
];
// for the sprintf statements
char
buffer
[
20
];
// for the sprintf statements
switch
(
digitalPinToTimer
(
pin
))
{
switch
(
digitalPinToTimer
(
pin
))
{
#if defined(TCCR0A) && defined(COM0A1)
#if defined(TCCR0A) && defined(COM0A1)
PWM_CASE
(
0
A
);
PWM_CASE
(
0
,
A
);
PWM_CASE
(
0
B
);
PWM_CASE
(
0
,
B
);
#endif
#endif
#if defined(TCCR1A) && defined(COM1A1)
#if defined(TCCR1A) && defined(COM1A1)
PWM_CASE
(
1
A
);
PWM_CASE
(
1
,
A
);
PWM_CASE
(
1
B
);
PWM_CASE
(
1
,
B
);
PWM_CASE
(
1
C
);
PWM_CASE
(
1
,
C
);
#endif
#endif
#if defined(TCCR2A) && defined(COM2A1)
#if defined(TCCR2A) && defined(COM2A1)
PWM_CASE
(
2
A
);
PWM_CASE
(
2
,
A
);
PWM_CASE
(
2
B
);
PWM_CASE
(
2
,
B
);
#endif
#endif
#if defined(TCCR3A) && defined(COM3A1)
#if defined(TCCR3A) && defined(COM3A1)
PWM_CASE
(
3
A
);
PWM_CASE
(
3
,
A
);
PWM_CASE
(
3
B
);
PWM_CASE
(
3
,
B
);
PWM_CASE
(
3
C
);
PWM_CASE
(
3
,
C
);
#endif
#endif
#ifdef TCCR4A
#ifdef TCCR4A
PWM_CASE
(
4
A
);
PWM_CASE
(
4
,
A
);
PWM_CASE
(
4
B
);
PWM_CASE
(
4
,
B
);
PWM_CASE
(
4
C
);
PWM_CASE
(
4
,
C
);
#endif
#endif
#if defined(TCCR5A) && defined(COM5A1)
#if defined(TCCR5A) && defined(COM5A1)
PWM_CASE
(
5
A
);
PWM_CASE
(
5
,
A
);
PWM_CASE
(
5
B
);
PWM_CASE
(
5
,
B
);
PWM_CASE
(
5
C
);
PWM_CASE
(
5
,
C
);
#endif
#endif
case
NOT_ON_TIMER
:
case
NOT_ON_TIMER
:
...
@@ -711,10 +711,10 @@ static bool PWM_status(uint8_t pin) {
...
@@ -711,10 +711,10 @@ static bool PWM_status(uint8_t pin) {
return
false
;
return
false
;
}
}
SERIAL_PROTOCOLPGM
(
" "
);
SERIAL_PROTOCOLPGM
(
" "
);
}
//
PWM
_status
}
//
pwm
_status
#define WGM_MAKE3(N) ((
TEST
(TCCR##N##B
,
WGM##N##2) >> 1) | (TCCR##N##A & (_BV(WGM##N##0) | _BV(WGM##N##1))))
#define WGM_MAKE3(N) (((TCCR##N##B
& _BV(
WGM##N##2)
)
>> 1) | (TCCR##N##A & (_BV(WGM##N##0) | _BV(WGM##N##1))))
#define WGM_MAKE4(N) (WGM_MAKE3(N) |
(TEST
(TCCR##N##B
,
WGM##N##3) >> 1)
)
#define WGM_MAKE4(N) (WGM_MAKE3(N) | (TCCR##N##B
& _BV(
WGM##N##3)
)
>> 1)
#define TIMER_PREFIX(T,L,N) do{ \
#define TIMER_PREFIX(T,L,N) do{ \
WGM = WGM_MAKE##N(T); \
WGM = WGM_MAKE##N(T); \
SERIAL_PROTOCOLPGM(" TIMER"); \
SERIAL_PROTOCOLPGM(" TIMER"); \
...
@@ -745,7 +745,7 @@ static void err_prob_interrupt() {
...
@@ -745,7 +745,7 @@ static void err_prob_interrupt() {
}
}
static
void
can_be_used
()
{
SERIAL_PROTOCOLPGM
(
" can be used as PWM "
);
}
static
void
can_be_used
()
{
SERIAL_PROTOCOLPGM
(
" can be used as PWM "
);
}
static
void
PWM
_details
(
uint8_t
pin
)
{
static
void
pwm
_details
(
uint8_t
pin
)
{
uint8_t
WGM
;
uint8_t
WGM
;
...
@@ -885,9 +885,7 @@ static void PWM_details(uint8_t pin) {
...
@@ -885,9 +885,7 @@ static void PWM_details(uint8_t pin) {
}
}
SERIAL_PROTOCOLPGM
(
" "
);
SERIAL_PROTOCOLPGM
(
" "
);
}
// PWM_details
}
// pwm_details
inline
void
report_pin_state
(
int8_t
pin
)
{
inline
void
report_pin_state
(
int8_t
pin
)
{
SERIAL_ECHO
((
int
)
pin
);
SERIAL_ECHO
((
int
)
pin
);
...
@@ -938,7 +936,7 @@ inline void report_pin_state_extended(int8_t pin, bool ignore) {
...
@@ -938,7 +936,7 @@ inline void report_pin_state_extended(int8_t pin, bool ignore) {
pinMode
(
pin
,
INPUT_PULLUP
);
// make sure input isn't floating
pinMode
(
pin
,
INPUT_PULLUP
);
// make sure input isn't floating
SERIAL_PROTOCOLPAIR
(
"Input = "
,
digitalRead_mod
(
pin
));
SERIAL_PROTOCOLPAIR
(
"Input = "
,
digitalRead_mod
(
pin
));
}
}
else
if
(
PWM
_status
(
pin
))
{
else
if
(
pwm
_status
(
pin
))
{
// do nothing
// do nothing
}
}
else
SERIAL_PROTOCOLPAIR
(
"Output = "
,
digitalRead_mod
(
pin
));
else
SERIAL_PROTOCOLPAIR
(
"Output = "
,
digitalRead_mod
(
pin
));
...
@@ -946,7 +944,7 @@ inline void report_pin_state_extended(int8_t pin, bool ignore) {
...
@@ -946,7 +944,7 @@ inline void report_pin_state_extended(int8_t pin, bool ignore) {
}
}
// report PWM capabilities
// report PWM capabilities
PWM
_details
(
pin
);
pwm
_details
(
pin
);
SERIAL_EOL
;
SERIAL_EOL
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment