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

support both STM8S and STM8L #26

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
934e734
remove AVR folder
cpuwolf Oct 26, 2013
5110282
remove STM8S peripheral device driver
cpuwolf Oct 26, 2013
ecad91d
add STM8L standard peripheral drivers V1.6.0
cpuwolf Oct 26, 2013
aa4e430
remove STM8S related files
cpuwolf Oct 26, 2013
fae5a87
fix IAR comile error
cpuwolf Oct 26, 2013
40655f0
add .gitignore file
cpuwolf Oct 26, 2013
e879e1f
remove useless header file
cpuwolf Oct 26, 2013
8f8bdb1
Update IAR project files
cpuwolf Oct 26, 2013
a04deda
add StdPeriph conf file and int vector file
cpuwolf Oct 26, 2013
45e1562
modify #include "xx" to #include <xx>
cpuwolf Oct 26, 2013
61adc0c
interrupt vector has a dedicated file
cpuwolf Oct 26, 2013
c9dbb0b
use UART1
cpuwolf Oct 26, 2013
34e2f06
Atomthreads tick timer adapts to STM8L StdPeriph
cpuwolf Oct 26, 2013
437ae09
rewrite main thread
cpuwolf Oct 26, 2013
819a54e
remove compile related file from folder STM8
cpuwolf Oct 27, 2013
4ec3703
create a new folder EWSTM8 for compile IAR
cpuwolf Oct 27, 2013
0d5a230
create a new folder for STVD/Cosmic compiler
cpuwolf Oct 27, 2013
5e24137
create a new folder for compile STVD/raisonance
cpuwolf Oct 27, 2013
004e200
interrupt handler should call kernel function
cpuwolf Oct 27, 2013
27f79e6
add arch idle handler function archIdleHandler()
cpuwolf Oct 27, 2013
3fa1902
force function to be compiled in IAR
cpuwolf Oct 28, 2013
777fa12
add function to get max idle time
cpuwolf Nov 3, 2013
6c60ee0
prepare to use halt in idle
cpuwolf Nov 3, 2013
acd9fc7
add RTC support
cpuwolf Nov 3, 2013
333be20
rename folder for stm8l only
cpuwolf Jan 25, 2014
c3c2453
folder change to stm8l
cpuwolf Jan 25, 2014
eea8aa0
add STM8S support
cpuwolf Jan 25, 2014
a758a08
STM8S works fine now
cpuwolf Jan 25, 2014
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
221 changes: 221 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
#################
## Eclipse
#################

*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath


#################
## Visual Studio
#################

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results

[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.Publish.xml
*.pubxml

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
App_Data/*.mdf
App_Data/*.ldf

#############
## Windows detritus
#############

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac crap
.DS_Store


#############
## Python
#############

*.py[co]

# Packages
*.egg
*.egg-info
dist/
build/
eggs/
parts/
var/
sdist/
develop-eggs/
.installed.cfg

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox

#Translations
*.mo

#Mr Developer
.mr.developer.cfg
.o
*.eww
*.dep
*.dbgdt
*.dni
*.wsdt
8 changes: 7 additions & 1 deletion kernel/atomkernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

/*
* Copyright (c) 2013 Wei Shuai <[email protected]>
* Modify to adapt STM8L
*
* 2013-10-27: add arch idle function
*/

/**
* \file
Expand Down Expand Up @@ -750,6 +755,7 @@ static void atomIdleThread (uint32_t param)
while (1)
{
/** \todo Provide user idle hooks*/
archIdleHandler(param);
}
}

Expand Down
33 changes: 33 additions & 0 deletions kernel/atomtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,4 +499,37 @@ static void atomTimerDelayCallback (POINTER cb_data)
*/
}
}
/**
* \b atomTimerUpdateIdle
*
* This is an public function for idle thread to caculate sleep time
* this function has to be called
*
* Find out maxmium sleep time
*
* @return idle ticks count
*/
#ifdef ATOM_IDLE_TICK
uint32_t atomTimerGetIdle (void)
{
ATOM_TIMER *next_ptr = timer_queue;;
uint32_t max_idle_ticks = -1;

/*
* Walk each timer's remaining ticks count and
* looking for minmium ticks count
*/
while (next_ptr)
{
/*find out minimum ticks count*/
if(next_ptr->cb_ticks < max_idle_ticks)
{
max_idle_ticks = next_ptr->cb_ticks;
}
/* Move on to the next in the list */
next_ptr = next_ptr->next_timer;
}
/*update max idle ticks count*/
return max_idle_ticks;
}
#endif
4 changes: 3 additions & 1 deletion kernel/atomtimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,7 @@ extern uint8_t atomTimerCancel (ATOM_TIMER *timer_ptr);
extern uint8_t atomTimerDelay (uint32_t ticks);
extern uint32_t atomTimeGet (void);
extern void atomTimeSet (uint32_t new_time);

#ifdef ATOM_IDLE_TICK
extern uint32_t atomTimerGetIdle (void);
#endif
#endif /* __ATOM_TIMER_H */
Loading