Skip to content

Commit

Permalink
merge default into stable for release v1.04
Browse files Browse the repository at this point in the history
  • Loading branch information
dimonomid committed Nov 4, 2014
2 parents 8d14009 + 2ac13da commit b9d9d0a
Show file tree
Hide file tree
Showing 114 changed files with 8,999 additions and 1,520 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ round-robin scheduling for the tasks with identical priority.

TNeoKernel was born as a thorough review and re-implementation of [TNKernel](http://tnkernel.com) v2.7. The new kernel has well-formed code, inherited bugs are fixed as well as new features being added, it is well documented and tested carefully with unit-tests.

Currently it is available for PIC32 only, but will probably be ported to other architectures. Tested on PIC32MX.
Currently it is available for PIC32/PIC24/dsPIC, and it will be ported at least to ARM Cortex M3 in a few months.

Comprehensive documentation is available in two forms: html and pdf.

Expand Down Expand Up @@ -40,7 +40,7 @@ new name for this project, in order to avoid confusion, hence "TNeoKernel".
Refer to the [Differences from TNKernel API](http://dfrank.bitbucket.org/tneokernel_api/latest/html/tnkernel_diff.html) page for details.

Together with almost totally re-writing TNKernel, I've implemented detailed
[unit tests](http://dfrank.bitbucket.org/tneokernel_api/latest/html/unit_tests.html) for it, to make sure I didn't break anything, and of course I've found several bugs in original TNKernel 2.7: refer to the section [Bugs of TNKernel 2.7](http://dfrank.bitbucket.org/tneokernel_api/latest/html/why_reimplement.html#why_reimplement__bugs). Unit tests are, or course, a "must-have" for the project like this; it's so strange bug original TNKernel seems untested.
[unit tests](http://dfrank.bitbucket.org/tneokernel_api/latest/html/unit_tests.html) for it, to make sure I didn't break anything, and of course I've found several bugs in original TNKernel 2.7: refer to the section [Bugs of TNKernel 2.7](http://dfrank.bitbucket.org/tneokernel_api/latest/html/why_reimplement.html#why_reimplement__bugs). Unit tests are, or course, a "must-have" for the project like this; it's so strange but original TNKernel seems untested.

Note that PIC32-dependent routines (such as context switch and so on) are
originally implemented by Anders Montonen; I examined them in detail and
Expand All @@ -65,3 +65,5 @@ company, Alexey Morozov and Alexey Gromov, for being flexible about my time.

For comprehensive information, refer to the documentation (see links at the top of this page)

Feel free to contact me at the Microchip forum, [TNeoKernel thread](http://goo.gl/1xKUwA).

6 changes: 6 additions & 0 deletions examples/basic/arch/pic24/.vimprj/.indexer_files
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

[tn_pic32_example_basic]
option:ctags_params = "--langmap=c:.c.h --languages=c"

$INDEXER_PROJECT_ROOT

68 changes: 68 additions & 0 deletions examples/basic/arch/pic24/.vimprj/my.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
" config file for Vim's plugin "vimprj"

" path to .vimprj folder
let s:sPath = expand('<sfile>:p:h')

" set .indexer_file to use
let g:indexer_indexerListFilename = s:sPath.'/.indexer_files'

let g:indexer_getAllSubdirsFromIndexerListFile = 1

" project-specific format settings
let &tabstop = 3
let &shiftwidth = 3

let s:o_dir = $INDEXER_PROJECT_ROOT.'/output/tmp/compiled_in_vim'

if !isdirectory(s:o_dir)
call mkdir(s:o_dir, "p")
endif

let g:indexer_handlePath = 0

call CheckNeededSymbols(
\ "The following items needs to be defined in your vimfiles/machine_local_conf/current/variables.vim file to make things work: ",
\ "",
\ [
\ '$MACHINE_LOCAL_CONF__PATH__MICROCHIP_XC32',
\ ]
\ )

let s:sCompilerExecutable = ''
if has('win32') || has('win64')
let s:sCompilerExecutable = 'xc32-gcc.exe'
else
let s:sCompilerExecutable = 'xc32-gcc'
endif

" Path to MPLAB .mcp project
let s:sProject = 'tn_pic32_example_basic.X'
call envcontrol#set_project_file($INDEXER_PROJECT_ROOT.'/'.s:sProject, 'MPLAB_X', {
\ 'parser_params': {
\ 'compiler_command_without_includes' : ''
\ .'"'.s:sCompilerExecutable.'" '
\ .' -g -D__DEBUG -x c -c -mprocessor=32MX440F512H -Wall -mips16'
\ .' -Os -MMD -MF "'.s:o_dir.'/%:t:r.o.d" -o "'.s:o_dir.'/%:t:r.o"',
\ },
\ 'handle_clang' : 1,
\ 'add_paths' : [
\ $MACHINE_LOCAL_CONF__PATH__MICROCHIP_XC32.'/lib/gcc/pic32mx/4.5.2/include',
\ $MACHINE_LOCAL_CONF__PATH__MICROCHIP_XC32.'/pic32mx/include',
\ ],
\ 'clang_add_params' : ''
\ .' -D __C32__'
\ .' -D __C32_VERSION__=1210'
\ .' -D __CLANG_FOR_COMPLETION__'
\ .' -D __LANGUAGE_C__'
\ .' -D __PIC32MX__'
\ .' -D __32MX440F512H__'
\ .' -D __PIC32_FEATURE_SET__=440'
\ .' -D __DEBUG'
\ .' -Wno-builtin-requires-header'
\ .' -Wno-unused-value'
\ .' -Wno-implicit-function-declaration'
\ .' -Wno-attributes'
\ .' -Wno-invalid-source-encoding'
\ ,
\ })

97 changes: 97 additions & 0 deletions examples/basic/arch/pic24/tn_cfg_appl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@

/*******************************************************************************
* TNKernel configuration
*
******************************************************************************/


#ifndef _TN_CFG_H
#define _TN_CFG_H


/*******************************************************************************
* USER-DEFINED OPTIONS
******************************************************************************/

/**
* Enables additional param checking for most of the system functions.
* It's surely useful for debug, but probably better to remove in release.
* If it is set, most of the system functions are able to return two additional
* codes:
*
* * `TN_RC_WPARAM` if wrong params were given;
* * `TN_RC_INVALID_OBJ` if given pointer doesn't point to a valid object.
* Object validity is checked by means of the special ID field of type
* `enum TN_ObjId`.
*
* @see `enum TN_ObjId`
*/
#define TN_CHECK_PARAM 1

/**
* Allows additional internal self-checking, useful to catch internal
* TNeoKernel bugs as well as illegal kernel usage (e.g. sleeping in the idle
* task callback). Produces a couple of extra instructions which usually just
* causes debugger to stop if something goes wrong.
*/
#define TN_DEBUG 1

/**
* Whether old TNKernel names (definitions, functions, etc) should be available.
* If you're porting your existing application written for TNKernel,
* it is definitely worth enabling.
* If you start new project with TNeoKernel, it's better to avoid old names.
*/
#define TN_OLD_TNKERNEL_NAMES 0

/*
* Whenter mutexes API should be available
*/
#define TN_USE_MUTEXES 1

/*
* Whether mutexes should allow recursive locking/unlocking
*/
#define TN_MUTEX_REC 1

/*
* Whether RTOS should detect deadlocks and notify user about them
* via callback (see tn_event_callback_set() function)
*/
#define TN_MUTEX_DEADLOCK_DETECT 1

/*
* API option for MAKE_ALIG() macro.
*
* There is a terrible mess with MAKE_ALIG() macro: TNKernel docs specify
* that the argument of it should be the size to align, but almost
* all ports, including "original" one, defined it so that it takes
* type, not size.
*
* But the port by AlexB implemented it differently
* (i.e. accordingly to the docs)
*
* When I was moving from the port by AlexB to another one,
* do you have any idea how much time it took me to figure out
* why do I have rare weird bug? :)
*
* So, available options:
*
* TN_API_MAKE_ALIG_ARG__TYPE:
* In this case, you should use macro like this:
* MAKE_ALIG(struct my_struct)
* This way is used in the majority of TNKernel ports.
* (actually, in all ports except the one by AlexB)
*
* TN_API_MAKE_ALIG_ARG__SIZE:
* In this case, you should use macro like this:
* MAKE_ALIG(sizeof(struct my_struct))
* This way is stated in TNKernel docs
* and used in the port for dsPIC/PIC24/PIC32 by AlexB.
*/
#define TN_API_MAKE_ALIG_ARG TN_API_MAKE_ALIG_ARG__SIZE


#endif // _TN_CFG_H


File renamed without changes.
Loading

0 comments on commit b9d9d0a

Please sign in to comment.