embedded

Compact decompression library for embedded use

雨燕双飞 提交于 2019-11-27 09:53:25
问题 We're currently creating a device for a customer that will get a block of data (like, say, 5-10KB) from a PC application. This is a bit simplified, so assume that the data must be passed and uncompressed a lot, not just once a year. The communication channel is really, really slow, so we'd like to compress the data beforehand, pass to the device and let it uncompress the data to its internal flash. The device itself, however, runs on a micro controller that is not really fast and does not

How to do Gesture Recognition using Accelerometers

女生的网名这么多〃 提交于 2019-11-27 09:38:23
问题 My goal is to recognize simple gestures from accelerometers mounted on a sun spot. A gesture could be as simple as rotating the device or moving the device in several different motions. The device currently only has accelerometers but we are considering adding gyroscopes if it would make it easier/more accurate. Does anyone have recommendations for how to do this? Any available libraries in Java? Sample projects you recommend I check out? Papers you recommend? The sun spot is a Java platform

Beagleboard bare metal programming

微笑、不失礼 提交于 2019-11-27 09:30:08
问题 I just got my BeagleBoard-Xm and I'm wondering if there is any detailed step by step tutorials on how to get a very simple bare metal software running on the hardware? The reason I ask is I want to deeply understand how the hardware architecture works, everything from the bootloader, linkers, interrupts, exceptions, MMU etc. I figured the best way is to get a simple hello world program to execute on the beagleboard xm without an OS. Nothing advanced, just start up the board and get a "hello

Is there a way to convert from UTF8 to iso-8859-1?

自闭症网瘾萝莉.ら 提交于 2019-11-27 09:29:09
My software is getting some strings in UTF8 than I need to convert to ISO 8859 1. I know that UTF8 domain is bigger than iso 8859. But the data in UTF8 has been previously upconverted from ISO, so I should not miss anything. I would like to know if there is an easy / direct way to convert from UTF8 to iso-8859-1. Thanks Nominal Animal Here is a function you might find useful: utf8_to_latin9() . It converts to ISO-8859-15 (including EURO, which ISO-8859-1 does not have), but also works correctly for the UTF-8 -> ISO-8859-1 conversion part of a ISO-8859-1 -> UTF-8 -> ISO-8859-1 round-trip. The

Polling or Interrupt based method

荒凉一梦 提交于 2019-11-27 09:25:17
问题 When should one use polling method and when should one use interrupt based method ? Are there scenarios in which both can be used ? 回答1: If the event of interest is: Asynchronous Urgent Infrequent then an interrupt based handler would make sense. If the event of interest is: Synchronous (i.e. you know when to expect it within a small window) Not Urgent (i.e. a slow polling interval has no ill effects) Frequent (i.e. majority of your polling cycles create a 'hit') then polling might be a

Optimizing member variable order in C++

喜欢而已 提交于 2019-11-27 09:11:25
问题 I was reading a blog post by a game coder for Introversion and he is busily trying to squeeze every CPU tick he can out of the code. One trick he mentions off-hand is to "re-order the member variables of a class into most used and least used." I'm not familiar with C++, nor with how it compiles, but I was wondering if This statement is accurate? How/Why? Does it apply to other (compiled/scripting) languages? I'm aware that the amount of (CPU) time saved by this trick would be minimal, it's

Fixed address variable in C

六月ゝ 毕业季﹏ 提交于 2019-11-27 08:22:42
For embedded applications, it is often necessary to access fixed memory locations for peripheral registers. The standard way I have found to do this is something like the following: // access register 'foo_reg', which is located at address 0x100 #define foo_reg *(int *)0x100 foo_reg = 1; // write to foo_reg int x = foo_reg; // read from foo_reg I understand how that works, but what I don't understand is how the space for foo_reg is allocated (i.e. what keeps the linker from putting another variable at 0x100?). Can the space be reserved at the C level, or does there have to be a linker option

C++, can I statically initialize a std::map at compile time?

╄→гoц情女王★ 提交于 2019-11-27 08:12:34
If I code this std::map<int, char> example = { (1, 'a'), (2, 'b'), (3, 'c') }; then g++ says to me deducing from brace-enclosed initializer list requires #include <initializer_list> in C++98 ‘example’ must be initialized by constructor, not by ‘{...}’ and that annoys me slightly because the constructor is run-time and can, theoretically fail. Sure, if it does, it will fail quickly and ought to do so consistently, so that I ought to quickly locate & correct the problem. But, still, I am curious - is there anyway to initialize map, vector, etc, at compile time? Edit: I should have said that I am

Looking for 16-bit x86 compiler

孤者浪人 提交于 2019-11-27 07:53:58
I am working on an embedded systems project and have run into an issue of the compiler being programatically embedded in the Paradigm C++ IDE. I would like to be able to automate building. The processor is the AMD186ES. I am not working with the OS - just baremetal stuff. I need to generate real-mode 16-bit 8086 machine code from C++. My googling indicates that G++ can build such code. My questions are: Can g++ be configured to build this machine code? Are there other C++ compilers that can do it as well? Hawken I am currently using gnu as (part of binutils and the assembler used for gcc) and

Slight Delay After Returning from Interrupt

时间秒杀一切 提交于 2019-11-27 07:33:49
问题 I've written a small program that uses a button on an STM32 Discovery board to act as a counter in either Binary/Decimal/Hexadecimal mode (screen cycles through the 3 options and once pressed, counts up to 16 for each press before resetting to cycling through options). I'm encountering one small "bug" (read, not really) that has me a little confused. If I count up in Decimal/Hexadecimal, it returns to cycling through the options immediately but if I have counted up in Binary it takes ~1sec or