2 of 2 people found this helpful
I've looked at both your posts and nowhere do you tell us what processor, language or development tools you are using.
Tell us these things, and post the blinky code you want to modify, and it will be possible for some one to help you.
You might also consider how accurate the pulse timing should be and if it should be readily adjustable in the future.
Hi I've done the needful.
Well, actually you haven't, quite.
What you have done is posted a load of links that mean I would have to do a parcel of work to find out what your target device actually is.
However, I can see enough to know that I can't help you (much) - you seem to be attempting something with a Moto Z (which is a phone ?)(the group you have posted this in suggests the same !) and the name of the source code file you refer to suggests that the target processor is some kind of ST Cortex part. The code is accessing the hardware via lots of library calls which are specific to the environment you are working in.
In order to make progress you will need to understand the library calls and their limitations, as well as the processor your code is running on and its limitations. The processor will be very adequately documented by ST but you will need to know what it is. The library code may or may not be documented, if it's open source at least you can look at it.
Normally, if you want to precisely generate a pulse on a pin you would use the timer hardware on the processor to directly control the pin. To know if this is possible in your case you would need the schematic showing exactly how the hardware is connected. The hardware approach will take a few lines of code to set up some registers in the processor, the approach taken in the c file you link to is a horribly complicated (and non-optimum) way to do a simple thing, without detailed knowledge of the whole system (hardware and software) I can't say which method of wiggling the pin is the best for you.
You haven't told us the overall object of your work - that might make a difference too.
Just realised a square wave by changing the blinky output to GPIO pin 10 instead of the perfboard LED
I need to generate a rectangular wave with an high time of 2 ms and low time of 998 ms.
I'm working on ubuntu linux environment for firmware development, kconfig-mconf configuration editor to Change nuttx configuration , Hardware used is the moto mods reference mod output observe in gpio pin 10 , nuttx.tftf file flashed using mdk-utility apk on moto z.
Any suggestions on how to implement this by editing the blinky code.
The Edited file has been attached.
Open source firmware code for this example is located at https://github.com/MotorolaMobilityLLC/nuttx - specifically: