Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
servo-headlight-control
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Vítek
servo-headlight-control
Commits
0fcc8dd9
Commit
0fcc8dd9
authored
9 years ago
by
Martin Vítek
Browse files
Options
Downloads
Patches
Plain Diff
Add SW
parent
64c756cd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SW/CMakeLists.txt
+38
-0
38 additions, 0 deletions
SW/CMakeLists.txt
SW/main.cpp
+31
-0
31 additions, 0 deletions
SW/main.cpp
with
69 additions
and
0 deletions
SW/CMakeLists.txt
0 → 100644
+
38
−
0
View file @
0fcc8dd9
cmake_minimum_required
(
VERSION 3.0
)
project
(
servo_headlight_control
)
set
(
AVR_UPLOADTOOL avrdude
)
set
(
AVR_PROGRAMMER usbasp
)
set
(
AVR_UPLOADTOOL_PORT usb
)
set
(
AVR_MCU atmega8
)
set
(
AVR_H_FUSE 0xC9
)
set
(
AVR_L_FUSE 0x1F
)
#set(CMAKE_BUILD_TYPE RelWithDebInfo)
set
(
CMAKE_BUILD_TYPE Release
)
set
(
MCU_SPEED
"3686400UL"
)
set
(
WITH_MCU OFF
)
set
(
WITH_MCU OFF CACHE BOOL
"Add the mCU type to the target file name."
FORCE
)
find_package
(
avr
)
add_definitions
(
"-DF_CPU=
${
MCU_SPEED
}
"
)
add_definitions
(
"-fpack-struct"
)
add_definitions
(
"-fshort-enums"
)
add_definitions
(
"-Wall"
)
add_definitions
(
"-funsigned-char"
)
add_definitions
(
"-funsigned-bitfields"
)
add_definitions
(
"-ffunction-sections"
)
add_definitions
(
"-c"
)
add_definitions
(
"-std=c++14"
)
set
(
SOURCE_FILES
main.cpp
)
include_directories
(
libs/src
)
add_subdirectory
(
libs rk
)
add_avr_executable
(
servo_headlight_control
${
SOURCE_FILES
}
)
avr_target_link_libraries
(
servo_headlight_control rk
)
This diff is collapsed.
Click to expand it.
SW/main.cpp
0 → 100644
+
31
−
0
View file @
0fcc8dd9
#include
<avr/io.h>
#include
"usart.h"
static
usart_regs
registers
{
&
UCSRA
,
&
UCSRB
,
&
UCSRC
,
&
UDR
,
&
UBRRL
,
&
UBRRH
,
};
usart
uart
(
registers
);
int
main
(
void
)
{
uart
.
set_operating_mode
(
uart
.
ASYNCHRONOUS_NORMAL
);
uart
.
set_baudrate
(
115200
);
uart
.
set_data_bits
(
8
);
uart
.
set_stop_bits
(
1
);
uart
.
set_parity
(
uart
.
PARITY_NONE
);
uart
.
enable_trasmitter
();
uart
.
transmit_string
(
"
\n
Servo headlight control
\n
"
);
for
(;;)
{
}
}
\ No newline at end of file
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