Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
strandstring
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik Strand
strandstring
Commits
974ff1e0
Commit
974ff1e0
authored
6 years ago
by
Erik Strand
Browse files
Options
Downloads
Patches
Plain Diff
Disable interrupts for put_char
This fixes the weird symbols that were randomly appearing.
parent
60ba91c9
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
strandstring/strandstring.pde
+6
-1
6 additions, 1 deletion
strandstring/strandstring.pde
with
6 additions
and
1 deletion
strandstring/strandstring.pde
+
6
−
1
View file @
974ff1e0
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
#include
<util/delay.h>
#include
<util/delay.h>
#include
<avr/pgmspace.h>
#include
<avr/pgmspace.h>
#include
"OneWire.h"
#include
"OneWire
Mod
.h"
#define output(directions,pin) (directions |= pin) // set port direction for output
#define output(directions,pin) (directions |= pin) // set port direction for output
#define set(port,pin) (port |= pin) // set port pin
#define set(port,pin) (port |= pin) // set port pin
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
#define max_buffer 25
#define max_buffer 25
void
put_char
(
volatile
unsigned
char
*
port
,
unsigned
char
pin
,
char
txchar
)
{
void
put_char
(
volatile
unsigned
char
*
port
,
unsigned
char
pin
,
char
txchar
)
{
noInterrupts
();
//
//
// send character in txchar on port pin
// send character in txchar on port pin
// assumes line driver (inverts bits)
// assumes line driver (inverts bits)
...
@@ -101,6 +102,7 @@ void put_char(volatile unsigned char *port, unsigned char pin, char txchar) {
...
@@ -101,6 +102,7 @@ void put_char(volatile unsigned char *port, unsigned char pin, char txchar) {
// char delay
// char delay
//
//
bit_delay
();
bit_delay
();
interrupts
();
}
}
void
put_string
(
volatile
unsigned
char
*
port
,
unsigned
char
pin
,
char
*
str
)
{
void
put_string
(
volatile
unsigned
char
*
port
,
unsigned
char
pin
,
char
*
str
)
{
...
@@ -146,6 +148,9 @@ void loop(void) {
...
@@ -146,6 +148,9 @@ void loop(void) {
PORTB
|=
led_pin
;
PORTB
|=
led_pin
;
//put_char(&serial_port, serial_pin_out, '1');
//put_char(&serial_port, serial_pin_out, '1');
}
}
put_string
(
&
serial_port
,
serial_pin_out
,
"hello world"
);
delay
(
500
);
return
;
byte
i
;
byte
i
;
byte
present
=
0
;
byte
present
=
0
;
...
...
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