Commit Graph

735 Commits

Author SHA1 Message Date
Mark Schulte
b3222bbc8a irq_dispatch: Add argument pointer to irq_dispatch
Provide a user defined callback context for irq's, such that when
registering a callback users can provide a pointer that will get
passed back when the isr is called.
2017-02-27 06:27:56 -06:00
Gregory Nutt
1d290c2b37 setvbuf: Add support for disabling I/O buffering. Initially cut; untested. 2017-02-09 09:24:44 -06:00
Gregory Nutt
62a1f6f110 up_timer_initialize() is named incorrectly. The prefix should be the architecture name, not up_ since it is private to the architecture. up_timerisr() is similarly misnamed and should also be private since it is used only with the xyz_timerisr.c files. Also updat TODO list. 2017-02-07 10:35:04 -06:00
Gregory Nutt
3ed091376c In all implementations of _exit(), use enter_critical_section() vs. disabling local interrupts. 2017-01-13 11:08:24 -06:00
Gregory Nutt
13d00344c9 Add configuration to prevent selection of Windows native toolchains when using Ubuntu under Windows 10 2017-01-02 07:16:47 -06:00
Gregory Nutt
3a0413c048 Back out most of 34be3e7c3c and update README again. Windows native tools cannot be used with Ubuntu under Windows 10 now. For Cygwin, that support depends on the 'cygpath -w' tool to convert POSIX paths to Windows paths. There is no corresponding tool for Ubuntu under Windows 10. 2017-01-01 16:29:03 -06:00
Gregory Nutt
34be3e7c3c Add configuration support for builds with Ubuntu under Windows 10 2017-01-01 15:34:23 -06:00
Paul A. Patience
912fe06a86 Add architecture-specific inttypes.h 2016-10-27 16:01:38 -04:00
Gregory Nutt
4b4dbc79a2 Move driver related prototypes out of include/nuttx/fs/fs.h and into new include/drivers/drivers.h 2016-07-20 13:15:37 -06:00
Gregory Nutt
d5388eca05 devrandom_register() must be called before devurandom_register() 2016-07-18 11:24:04 -06:00
Gregory Nutt
1660329d06 Rename up_rnginitialize to devrandom_register 2016-07-18 10:55:37 -06:00
David Alessio
6cefbc0c3f This change provides an option to add /dev/urandom to all architectures. The pseudo-random algorithm I choose strikes an arguably-good balance between being "random" and small/fast enough for 8/16 bit MCUs. It’s the well-documented xorshift128 algorithm. It has an internal state of 128 bits that can be [re-]seeded with a write. 2016-07-17 06:42:26 -06:00
Gregory Nutt
e7f0a56498 Correct some comments 2016-07-15 13:13:53 -06:00
Gregory Nutt
7b298a828d up_pminitialize() needs to be called from instances of up_initialize() 2016-07-15 13:11:28 -06:00
Gregory Nutt
d3b3c71d97 All architectures: Add logic to automatically register /dev/ptmx a boot time 2016-07-15 11:54:41 -06:00
Gregory Nutt
5118264e6c Rename CONFIG_SYSLOG_CONSOLE to CONFIG_CONSOLE_SYSLOG 2016-06-21 09:35:51 -06:00
Gregory Nutt
62d8f839c7 SYSLOG: Now a two phase initialization. Some SYSLOG channels cannot be initialized until later in the bringup 2016-06-21 07:52:24 -06:00
Gregory Nutt
7f16548f57 Replaces last three commits. Does the same thing, but does it in a way that does not change the usage model. 2016-06-21 05:26:08 -06:00
Gregory Nutt
c05da80a27 Eliminate a warning 2016-06-20 22:54:58 -06:00
Gregory Nutt
505ca542e8 Remove some last traces of lowvsyslog that were missed; Add a SYSLOG emergency channel for handling assertion output more cleanly 2016-06-20 16:11:50 -06:00
Gregory Nutt
2a751068e6 Without lowsyslog() *llerr() is not useful. Eliminate and replace with *err(). 2016-06-20 12:44:38 -06:00
Gregory Nutt
43eb04bb8f Without lowsyslog() *llinfo() is not useful. Eliminate and replace with *info(). 2016-06-20 11:59:15 -06:00
Gregory Nutt
d40a473f72 Without lowsyslog() *llwarn() is not useful. Eliminate and replace with *warn(). 2016-06-20 09:37:08 -06:00
Gregory Nutt
2b445ddccc Remove lowsyslog(). The new syslog() includes all of the functionality of lowsyslog(). No longer any need for two interfaces. 2016-06-20 08:57:08 -06:00
Gregory Nutt
5b2aa7bf99 Remove all traces of CONFIG_SYSLOG 2016-06-19 13:59:43 -06:00
Gregory Nutt
0f18f3bd15 Move RAMLOG initialize from up_initialilize.c files to syslog_initialize(). up_initialize.c files now call syslog_initialize() unconditionally 2016-06-19 09:39:21 -06:00
Gregory Nutt
ac18dc27ca Common/Calypso/C5471: Convert *err() to either *info() or add ERROR:, depending on if an error is reported 2016-06-17 15:22:48 -06:00
Gregory Nutt
b39e53391d Add underscore at beginning of alert() as well 2016-06-16 12:38:05 -06:00
Gregory Nutt
0c8c7fecf0 Add _ to the beginning of all debug macros to avoid name collisions 2016-06-16 12:33:32 -06:00
Gregory Nutt
ba03134bed Centralize definitions associated with CONFIG_DEBUG_SPI 2016-06-15 10:41:13 -06:00
Gregory Nutt
5cc9a13f95 arch/avr/: Change some *err() message to *info() messages if what was a *dbg() message does not indicate and error condition. 2016-06-14 12:45:12 -06:00
Gregory Nutt
a98bc05f65 New debug macro: alert(). This is high priority, unconditional output and is used to simplify and stanardize crash error reporting. 2016-06-14 09:07:53 -06:00
Gregory Nutt
fd57fde659 Back out part of previous commit 2016-06-13 14:44:28 -06:00
Gregory Nutt
93e7b5d7a0 Eliminate some warnings 2016-06-13 14:15:54 -06:00
Gregory Nutt
0f249016a0 Eliminate some warnings 2016-06-13 14:01:32 -06:00
Gregory Nutt
bed85cc515 configs/: Remove one more reference to non-existent SPI_VERBOSE setting 2016-06-12 18:48:13 -06:00
Gregory Nutt
a1469a3e95 Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err() 2016-06-11 15:50:49 -06:00
Gregory Nutt
e99301d7c2 Rename *lldbg to *llerr 2016-06-11 14:55:27 -06:00
Gregory Nutt
1cdc746726 Rename CONFIG_DEBUG to CONFIG_DEBUG_FEATURES 2016-06-11 14:14:08 -06:00
Gregory Nutt
fc3540cffe Replace all occurrences of vdbg with vinfo 2016-06-11 11:59:51 -06:00
Gregory Nutt
3a74a438d9 Rename CONFIG_DEBUG_VERBOSE to CONFIG_DEBUG_INFO 2016-06-11 11:50:18 -06:00
Gregory Nutt
9ec104834a Remove CONFIG_USARTn_ISUART 2016-05-25 11:21:48 -06:00
Gregory Nutt
249a2e48e5 Rename CONFIG_ARCH_HAVE_USARTn to CONFIG_USARTn_SERIALDRIVER 2016-05-25 10:39:23 -06:00
Gregory Nutt
fb484a581f All GCC final arch/*/src/Makefiles: Allow --start-group and --end-group to be redefined for the case where GCC is used to link (instead of LD). Suggested by Paul Alexander Patience. 2016-05-17 10:43:15 -06:00
Gregory Nutt
99e695398c Rename up_boot to arm_boot 2016-05-12 13:42:49 -06:00
Gregory Nutt
48106e605a Merge in arch/ submodule 2016-04-10 07:49:41 -06:00
Gregory Nutt
bd846c2e72 All architectures: Register the schedule note driver if enabled 2016-03-17 17:00:59 -06:00
Gregory Nutt
4d4f54a789 Rename current_regs to g_current_regs; For ARM, g_current_regs needs to be an array to support multiple CPUs 2016-03-09 13:41:48 -06:00
Gregory Nutt
9c63736c98 Standard some naming if code sectino comments 2016-02-21 18:06:09 -06:00
Gregory Nutt
666cc280f4 Rename irqenable() to up_irq_enable(); rename irqdisable() to up_irq_disable() 2016-02-14 16:54:09 -06:00
Gregory Nutt
83bc1c97c3 Rename irqsave() and irqrestore() to up_irq_save() and up_irq_restore() 2016-02-14 16:11:25 -06:00
Gregory Nutt
70e502adb0 Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section() 2016-02-13 19:11:09 -06:00
Gregory Nutt
c62177be00 AVR: Replace explicit references to g_readytorun with indirect references via the macro this_task() 2016-02-06 13:55:15 -06:00
Gregory Nutt
afbd0f55c3 For AVR MCUs, rename up_spiinitialize to avr_spibus_initialize 2016-01-27 08:00:28 -06:00
Gregory Nutt
b7cbbab761 Remove CONFIG_SPI_OWNBUS: Now it is not just a good idea, it is the law 2016-01-23 18:10:21 -06:00
Gregory Nutt
4bd6adb725 Add dummy hwfeatures method to all SPI interfaces 2016-01-23 15:09:38 -06:00
Gregory Nutt
4e8772dfca ATMEGA: A few trivial updates to USART-related macros 2016-01-16 14:38:28 -06:00
Gregory Nutt
6ca2315cf0 ATMEGA: Make some naming used with the 2560 compatible with other ATmega parts 2016-01-16 13:41:49 -06:00
Gregory Nutt
4b71d74a2b Minor typo fix in warning 2016-01-09 19:57:48 -06:00
Gregory Nutt
10001f8556 WINTOOl should be selected only for Cygwin. MSYS and native should not have it. 2016-01-09 16:34:33 -06:00
Gregory Nutt
7231439290 Test for CONFIG_AVR_HAS_MEMX_PTR must be after inclusion of config.h 2016-01-09 08:11:25 -06:00
Gregory Nutt
d0578bfc2b Changes to last pull request needed for conformance with coding standard 2016-01-09 07:25:24 -06:00
Gregory Nutt
203899cca8 Merged in kloper/arch/atmega2560 (pull request #48)
debug macros for AVR (take #2): Introduce debug macro hooks for AVR
2016-01-09 07:17:35 -06:00
Dimitry Kloper
642b92b391 Introduce debug macro hooks for AVR
When AVR_HAS_MEMX_PTR is enabled provide dbg macro hooks that place
the format strings in program memory releasing RAM for other tasks.
2016-01-09 14:44:38 +02:00
Gregory Nutt
7a393f9e8b Eliminate some warnings 2016-01-08 11:26:16 -06:00
Gregory Nutt
278701f93d Eliminate warnings (one of which looks like a bug) 2016-01-08 11:22:57 -06:00
Gregory Nutt
68e3f5d9ce All AVR toolchain configuration names must end with _TOOLCHAIN to work properly with nuttx/tools/testbuilds.sh 2016-01-08 10:39:59 -06:00
Gregory Nutt
dfe3240973 AVR: Rename ATMEGA_PC_SIZE to AVR_PC_SIZE since it must be used in common AVR logic. Add definitions for other AVR architectures as necessary for compilation 2016-01-07 08:14:09 -06:00
Gregory Nutt
951c40215a Atmega: Eliminate some warnings 2016-01-06 09:50:15 -06:00
Dimitry Kloper
16212f19e7 AVR: Introduce Atmel Toolchain as a configuration option
Atmel's AVR8 toolchain is similar to WinAVR, but at present moment
it has one important feature that WinAVR does not. The __flash and __memx
allow built in comiler support for transparent program memory pointers.
Functions that use such pointers will work both with RAM arrays and
flash memory arrays. The compiler generates an appropriate code automatically.
For systems with tiny memory like atmega, this is very important and
allows to move all static const strings into flash.
2016-01-04 21:53:44 +02:00
Dimitry Kloper
b9f06dc5e3 ATMEGA2560: Fix compilation when CONFIG_DISABLE_SIGNALS is undefined 2016-01-04 21:39:48 +02:00
Gregory Nutt
71c289ce4f Rename all architecture files of form xyz_internal.h to just xyz.h 2015-12-29 18:07:11 -06:00
Gregory Nutt
68cc2ecfd2 ATMEGA2560: Most cosmetic changes from review of pull request 2015-12-29 13:02:20 -06:00
Dimitry Kloper
0b8a43abbb Merged nuttx/arch/master into atmega2560 2015-12-29 19:10:57 +02:00
Dimitry Kloper
3c0c90e07d Minor identation fix 2015-12-29 19:09:20 +02:00
Dimitry Kloper
3746305f12 AVR: Minor adapt to a differnt TIMER IRQ notions for Atmega2560 2015-12-29 19:08:13 +02:00
Dimitry Kloper
556954141e AVR: Add support for AVR chips with 24-bit Program Counter register
The main challenge is to change the context switch code to be aware of the
extra byte that is saved on stack during call and intterupt. This relates also
to the task startup and signal handling.
2015-12-29 19:01:06 +02:00
Dimitry Kloper
99aab135b2 AVR: Make setting of XDIV optional for platforms that support it
Put setting of XDIV into ifdef since not AVR platforms support it.
2015-12-29 18:56:12 +02:00
Dimitry Kloper
462307f4b7 AVR: Clear EIND on system start-up
For AVR chips (Atmega2560) Program Counter register larger than 16 bits
EIND represents the most significant byte that is used for EICALL and EIJMP
instructions.

Setting of EIND is normally managed by compiler, but I have seen a situation
when for first 64K flash segment compiler didn't set EINT explicitly. Thus
setting EIND at system startup makes sure we are safe.
2015-12-29 18:46:28 +02:00
Dimitry Kloper
9a4a06bf47 AVR: Explicitly disable interrupts as the first step of system init
Disabling interrupts at the very beginning of system init does not
make sense after reset since interrupts are disabled anyway. But
it is very convenient for debugging purposes, in situations when the
system misbehaves and ocassionally jumps to zero.
2015-12-29 18:35:36 +02:00
Dimitry Kloper
ff5e589f76 AVR: add support for TCGETS and TCSETS terminal controls
Sometimes I need UART to support binary data transfer, TCSETS/TCGETS allow
stwitching into binary mode.
2015-12-29 17:56:44 +02:00
Dimitry Kloper
d6f6e41a36 AVR: Fix linking error for AVR platforms that have no ARCH_HAVE_LEDS defined
Minor bug while working on Arduino Mega support. I didn't add support
for ARCH_HAVE_LEDS and have it undefined in .config. To my surprise compilation
failed since AVR code had a related function compiled in.
2015-12-29 17:26:11 +02:00
Dimitry Kloper
8f8b88f532 AVR: Fix resulting nuttx file name when EXEEXT is not empty
arch/avr/Makefile is adding extra EXEEXT to the
nuttix image file. This was not discovered since in most configurations
EXEEXT is empty string.
2015-12-29 17:19:30 +02:00
Dimitry Kloper
41bdcd16b8 Change notation of PCH and PCL registers into PC0 and PC1
This is for forthcoming Atmega2560 support. The Atmega2560 has 24-bit PC
thus, PCH and PCL would become PCH, PCM and PCL (M for Middle). The problem
that in this notation PCM is equivalent to former PCH. This makes compatable
porting kind of difficult, at least for my taste.

Instead PCH becomes PC0 and PCL becomes PC1 (think of the index as order of
bytes pushed to stack when call is performed, PC0 as MSB goes first, PC1
goes to stack second, and for 24-bit PC, PC2 as LDB goes last).
2015-12-28 00:46:24 +02:00
Dimitry Kloper
0c1294d332 Introduce a new Kconfig variant for Atmega2560 and add some basic stuff
Modify Kconfig to be aware of the new chip.
Add all the interrupt hanler constants and vectors where needed.
Move contsatnts from generic to specific headers when needed.
2015-12-27 01:47:35 +02:00
Gregory Nutt
46da8a07ef Costmetic changes from review of merge request 2015-12-26 16:39:51 -06:00
Dimitry Kloper
0998876ef6 AVR: Fix interrupt bombing during a context switch
TCB_RESTORE macro has a problem when restoring Status Register
and returning from the function (in up_fullcontextrestore()) as non-atomic action.

If there is some frequently occurring interrupt, chances are that we will
enter the interrupt handler just before ret is called.
The handler may cause a context switch which, when unrolled, will
execute up_fullcontextrestore() function that employs TCB_RESTORE.
It will be interrupted again just before return, leaving part of context
switch content un-popped again, etc... Thus, chances are that the stack will
eventually blow.

Note that this is not some edge condition fix. This bug was discovered when
testing AVR with UART configured to work on 115200 baud rate.
2015-12-26 21:55:40 +02:00
Gregory Nutt
927b1dcc1f Initialize the telnet factory as part of the common architecture intialization 2015-12-07 11:40:29 -06:00
Gregory Nutt
2afd4595e4 Re-think how __KERNEL__ option is set in architecture Makefiles. Should be passed in EXTRADEFINES 2015-11-26 06:59:35 -06:00
Gregory Nutt
4aa3dcb51a __KERNEL__ should be defined when compiler architecture specific logic 2015-11-25 18:05:36 -06:00
Gregory Nutt
14d7ede265 All instances of up_initialize() should call loop_register() is CONFIG_DEV_LOOP=y 2015-11-25 17:10:41 -06:00
Gregory Nutt
076b05b460 In Kconfig of all CPUs with 16-bit address, force CONFIG_MM_SMALL=y 2015-11-23 12:16:35 -06:00
Gregory Nutt
79df561669 Rename board_led_off to board_autoled_off 2015-11-01 09:09:36 -06:00
Gregory Nutt
b28e32e3d3 Rename board_led_on to board_autoled_on 2015-11-01 09:07:06 -06:00
Gregory Nutt
a73d266469 AVR: Fix some spacing issues 2015-10-07 16:24:54 -06:00
Gregory Nutt
7a63e976ad Remove TABs 2015-10-04 16:00:42 -06:00
Gregory Nutt
6fc6d17760 Fix some spacing problems 2015-10-04 14:59:08 -06:00
Gregory Nutt
9caf33e13b Standardize the width of all comment boxes in C header files 2015-10-03 07:28:30 -06:00
Gregory Nutt
7ced84c5f0 Standardize the width of all comment boxes in C files 2015-10-03 07:25:03 -06:00
Gregory Nutt
36726b1bc4 Standardize the width of all comment boxes in header files 2015-10-02 17:42:29 -06:00