|
t0xic_kitt3n
|
Ah. This would be better than the current function, where you'd have to make sure the seed is different each time the prog is run.
|
|
|
|
|
Logged
|
██████ ██ ██ ███████ ████ ██ ██ ██ ███████ █ ██ █ ██ ██ ██ █ ██ ██ ████ ███ ███ ██ █ ██ ██ ██ ██ ██ ██ ██ ██ ███████ ██ ██ ██ ██ ██ █ ██ ██ ██ ███████ ██ █ ██ ██████ █████ ██ ██ ██ ██ █ ██ █████ ██ ██ ██ ██ █ ██ ███ ██████ ██ ██ ██ █ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ █ ██ ██ ██ ██ ██ ██ ██ █ ████ ██ ██ ███████ █████ ██ ██ ██ ██ ███████
|
|
|
apcalc
The Game
Coder Of Tomorrow
LV10 31337 u53r (Next: 2000)
Offline
Gender: 
Last Login: 12 May, 2013, 20:31:24
Date Registered: 20 March, 2010, 16:31:47
Location: 2003 UB313
Posts: 1393
Total Post Ratings: +118
|
Here is a simple routine to set the LED a certain color. It does not support blinking. I know it is kinda useless, but I though I would post it anyway. Pass it 0 to turn the LED off, 1 to make it green, 2 to make it red, or 3 to make it yellow: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| void set_led(int color) { *(volatile unsigned*) 0x90110B00=0x00; switch(color) { case 0: break; case 1: *(volatile unsigned*) 0x90110B00=0x10; break; case 2: *(volatile unsigned*) 0x90110B00=0x20; break; case 3: *(volatile unsigned*) 0x90110B00=0x30; }; }
|
|
|
|
|
|
Logged
|
|
|
|
calc84maniac
Epic z80 roflpwner
Coder Of Tomorrow
LV11 Super Veteran (Next: 3000)
Offline
Gender: 
Last Login: 14 May, 2013, 10:02:35
Date Registered: 28 August, 2008, 05:09:05
Location: Right behind you.
Posts: 2735
Total Post Ratings: +373
|
It's actually not necessary to write 0 first unless you are using the blinker. A simplified version of this routine would be
*(volatile unsigned*) 0x90110B00 = color << 4;
|
|
|
|
|
Logged
|
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman
|
|
|
|
SirCmpwn
Guest
|
So I got the skeleton downloaded and set up under Ndless 1.7. However, using MinGW to compile it, it tells me "make: arg-elf-gcc: Command not found" and errors out. Any idea why? EDIT: Got that working, but now objcopy won't work. "arm-elf-objcopy: Command not found"
|
|
|
|
« Last Edit: 27 October, 2010, 16:46:58 by SirCmpwn »
|
Logged
|
|
|
|
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
Offline
Gender: 
Last Login: 17 May, 2013, 08:07:39
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 765
Total Post Ratings: +151
|
If you are using Ndless 1.7, I don't think a skeleton is required anymore. Are you using YAGARTO v4.5.1 or later? Then the GCC and binutils commands used in your Makefile should begin with "arm-none-" instead of "arm-elf-". I also suggest you use the Makefile template provided in the samples/hello directory of Ndless v1.7. You can also try to begin with the step-by-step tutorial available on Hackspire: http://hackspire.unsads.com/wiki/index.php/C_and_assembly_development_introduction
|
|
|
|
|
Logged
|
|
|
|
|
SirCmpwn
Guest
|
Thanks, and I went through that tutorial, it works great  I want to get the libraries from the skeleton working, though, I'll post more specific errors in a few.
|
|
|
|
|
Logged
|
|
|
|
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
Offline
Gender: 
Last Login: 17 May, 2013, 08:07:39
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 765
Total Post Ratings: +151
|
Aren't bwang's functions now packed as a static library? This is really the best way to make code available to other developers. We can add tutorials on how to build and import static libraries to Hackspire if needed.
|
|
|
|
|
Logged
|
|
|
|
|
SirCmpwn
Guest
|
Well, not knowing what that means, I can't really answer it. I got it working, though.
|
|
|
|
|
Logged
|
|
|
|
|
bwang
|
There is a static version lurking somewhere on this thread. I probably should update the OP and change skeleton to just a set of libraries, since it is no longer necessary for Ndless 1.7.
|
|
|
|
|
Logged
|
|
|
|
|
SirCmpwn
Guest
|
Good idea. Right now I'm just using the libraries.
|
|
|
|
|
Logged
|
|
|
|
|