embedded

Quickly find whether a value is present in a C array?

℡╲_俬逩灬. 提交于 2019-12-02 13:47:59
I have an embedded application with a time-critical ISR that needs to iterate through an array of size 256 (preferably 1024, but 256 is the minimum) and check if a value matches the arrays contents. A bool will be set to true is this is the case. The microcontroller is an NXP LPC4357, ARM Cortex M4 core, and the compiler is GCC. I already have combined optimisation level 2 (3 is slower) and placing the function in RAM instead of flash. I also use pointer arithmetic and a for loop, which does down-counting instead of up (checking if i!=0 is faster than checking if i<256 ). All in all, I end up

Extracting an OLEObject (XML Document) from PowerPoint VBA

…衆ロ難τιáo~ 提交于 2019-12-02 13:16:26
I am developing an application in VBA. Userforms connect to a COM object that reads an SPSS Statistics SAV file or an SPSS Dimensions MDD file. Part of this application stores metadata in an XML document so that we can retrieve the metadata later and repopulate or update the graphics created from the userforms. This works fine as long as we rely on an XML file existing on a local drive - which is not a desirable solution. We would prefer to embed (not link) the XML in to the PPTM file, which I have been able to do (see attached). The problem is that I can't find a way to get VBA to extract the

How can I broadcast data to multiple SPI slaves and how it works?

守給你的承諾、 提交于 2019-12-02 13:10:20
I know basic SPI protocol and its master to slave operations. I want to know that is it possible to broadcast data on multiple slave? If it is possible then how it works. I've heard that after writing to any SPI slave you have to read from slave even if you are not going to use read data. How is this possible in case broadcast if broadcast is possible? No, it's not possible. Since SPI is 4- wire interface. The SS line is used for slave selection.One SPI master can have multiple slaves but it cannot select all the slaves at once since it is either using some bit or SS signal to select the slave

How to use va_list correctly in a sequence of wrapper functions calls?

巧了我就是萌 提交于 2019-12-02 12:37:43
I have an ethernet library for microcontroller (keil rl-tcpnet for lpc2478). Library uses va_list (standard pointer to arg array macro defined in stdarg.h) in debug output function in such a way: void __debug__ (const char *fmt, ...) { va_list args; va_start (args,fmt); vprintf (fmt,args); va_end (args); } However vprintf sends data to incorrect stream and I need to redirect debug output of library to correct serial port. Library has .c cofigure files and I write c++ code so I use wrapper function pointers to call c++ style code from c code. So I rewrite this function: extern void (*

If an embedded system coded in C is 8 or 16-bit, how will it manipulate 32-bit data types like int?

痴心易碎 提交于 2019-12-02 12:02:59
I think I'm thinking about this the wrong way, but I'm wondering how an embedded system with less than 32-bits can use 32-bit data values. I'm a beginner programmer so go easy on me :) base 10 0100 <- carry in/out 5432 +1177 ====== 6609 never brought up in class but we can now extend that to two operations 100 32 +77 ====== 09 01 54 +11 ====== 66 and come up with the 6609 result because we understand that it is column based and each column treated separately. base 2 1111 +0011 ===== 11110 1111 +0011 ===== 10010 110 11 +11 ===== 10 111 11 +00 ===== 100 result 10010 you can break your operations

Checksum code implementation for Neon in Intrinsics

半腔热情 提交于 2019-12-02 11:14:10
问题 I'm trying to implement the checksum computation code(2's complement addition) for NEON, using intrinsic. The current checksum computation is being carried out on ARM. My implementation fetches 128-bits at once from the memory into NEON registers and does SIMD (addition), and result is folded to a 16-bit number from a 128-bit number. Everything looks to be working fine, but my NEON implementation is consuming more time that of the ARM version. ARM version takes: 0.860000 s NEON version takes:

Can you explain this Embedded MATLAB Function error?

六月ゝ 毕业季﹏ 提交于 2019-12-02 11:02:42
问题 I'm having a problem sending a value from a GUI to an Embedded MATLAB Function (EMF) in a Simulink model. I get this value from a slider in my GUI and send it to an EMF block in my model. I can confirm that the value is being transferred correctly from my GUI to my Simulink block, since I can display the value with a display block in my model and see the value change when I change the slider position in my GUI. However I keep getting this error when I run my model: Could not determine the

C global anonymous struct / union

我的未来我决定 提交于 2019-12-02 10:11:05
I have a uint64 variable which often only requires high or low 32 bit access. I am using a 32-bit ARM Cortex M0, and to help with speed and I am trying to overlap the uint64 variable with two uint32 variables in C, using anonymous structures in the hope of avoiding pointer arithmetic to access members. Is what I am trying to do possible? It could be that using a named union is just as fast, but now I'm just intrigued if it can be done without. The following does not compile successfully: http://goo.gl/ejx37y #include <stdint.h> volatile union { uint64_t ab; struct { uint32_t a, b; }; }; int

embedded linux, application state freeze, relaunch

北战南征 提交于 2019-12-02 09:53:13
问题 We have an embedded application, now it requires its state to be saved and reloaded. Just like in PC games, where you save it before you have to go out and breath some fresh air.The product is quiet evolutionary in nature, no proper design so identifying data to be saved is not an option. The software is in C so all data has fixed addresses (.data segment), its also deterministic,a and no dynamic memory allocations. So theoretically I take a back up of this data segment in a file and on

tslib not creating device

允我心安 提交于 2019-12-02 09:31:45
I am trying to embed tslib on an ARM system, in order to use a touchscreen device ; I already installed it successfully but unfortunately I can't retrieve all my notes to do it again. x) I cross-compiled the libraries files, and I put them into /usr/lib ; I have created the conf file /etc/ts.conf and I have exported the good environment variables : export TSLIB_TSDEVICE="/dev/event2" export TSLIB_CONFFILE="/etc/ts.conf" Here is my problem : tslib doesn't seem to create the event device when I plug the device in. And here is the result of *ts_calibrate* : ts_open: No such file or directory I