Skip to content

Commit

Permalink
changed the foldername Duinoedu
Browse files Browse the repository at this point in the history
  • Loading branch information
karlTH committed Aug 4, 2014
2 parents 7f5974b + 6bbcd6d commit ad9892e
Show file tree
Hide file tree
Showing 53 changed files with 169 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ bin/
*~
src/main/resources/com/ardublock/block/ardublock.zip
deploy.sh
<<<<<<< HEAD
=======
test-output
src/main/resources/com/ardublock/block/littlebits/files
>>>>>>> upstream/master
4 changes: 4 additions & 0 deletions resources/libraries/SCoop/SCoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,4 +966,8 @@ uint16_t SCoopFifo::flushNonAtomic() { // empty the fifo
ptrOut = ptrMin;
return (ptrMax-ptrMin); }

<<<<<<< HEAD

=======

>>>>>>> upstream/master
4 changes: 4 additions & 0 deletions resources/libraries/SCoop/SCoop.h
Original file line number Diff line number Diff line change
Expand Up @@ -641,5 +641,9 @@ type name##type##number [ number ]; \
SCoopFifo name ( name##type##number , sizeof( type ), number );

#endif
<<<<<<< HEAD

=======

>>>>>>> upstream/master

Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,8 @@ void loop3() {
// We must call 'yield' at a regular basis to pass
// control to other tasks.
yield(); // not really needed with scoop as there is already one yield() call in the library
<<<<<<< HEAD
}
=======
}
>>>>>>> upstream/master
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,8 @@ defineTaskLoop(loop3) {
// We must call 'yield' at a regular basis to pass
// control to other tasks.
// yield(); // not needed with SCoop, already included in the library , at the end of each loop
<<<<<<< HEAD
}
=======
}
>>>>>>> upstream/master
4 changes: 4 additions & 0 deletions resources/libraries/SCoop/examples/example1/example1.ino
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ defineTimerRun(Timer1,100)

void setup() { Serial.begin(57600); while (!Serial); mySCoop.start(); }
void loop() { Serial.println("do whatever you want here also"); mySCoop.sleep(500); }
<<<<<<< HEAD

=======

>>>>>>> upstream/master
4 changes: 4 additions & 0 deletions resources/libraries/SCoop/examples/example2/example2.ino
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,8 @@ TimerUp T4; // from 0 to 1 billion every ms
#endif
}
mySCoop.yield(); // switch to next elligible task or event or timer
<<<<<<< HEAD
}
=======
}
>>>>>>> upstream/master
4 changes: 4 additions & 0 deletions resources/libraries/SCoop/examples/example3/example3.ino
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ void loop() {
increment();
#endif
}
<<<<<<< HEAD

=======

>>>>>>> upstream/master
4 changes: 4 additions & 0 deletions resources/libraries/SCoop/examples/example4/example4.ino
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,8 @@ void setup() {

void loop() {
}
<<<<<<< HEAD

=======

>>>>>>> upstream/master
4 changes: 4 additions & 0 deletions resources/libraries/SCoop/examples/example5/example5.ino
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,8 @@ void setup() {
void loop() {
// nothing to do here then
}
<<<<<<< HEAD

=======

>>>>>>> upstream/master
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,8 @@ long x,y,z,t;
void loop()
{ }

<<<<<<< HEAD

=======

>>>>>>> upstream/master
7 changes: 7 additions & 0 deletions resources/libraries/SCoop/readme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<<<<<<< HEAD
SCOOP LIBRARY
project hosted on google code:
check latest version and documentation here:
https://code.google.com/p/arduino-scoop-cooperative-scheduler-arm-avr/
=======
SCOOP LIBRARY
project hosted on google code:
check latest version and documentation here:
https://code.google.com/p/arduino-scoop-cooperative-scheduler-arm-avr/
>>>>>>> upstream/master
87 changes: 87 additions & 0 deletions resources/libraries/SCoop/scoop change log.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<<<<<<< HEAD
SCoop V1.2 is out and brings lot of goodies :)

Change log
Expand Down Expand Up @@ -82,4 +83,90 @@ V1.1 brings SCoopFifo and corect basic bugs. 17 pages user guide

V1 first verions introducing SCoopTask, SCoopTimer, SCoopEvent. Includes extra libraries for Input, Outputs, InputFiltered, TimerUp & Timer Down. 14 pages user guide.

=======
SCoop V1.2 is out and brings lot of goodies :)

Change log

V1.2:
- new rewritten yield() methods. Tasks are now registered on the "right hand side" of the list and timer+event on the "left hand side". when the Scheduler launches a tasks, the task might switch itself to the next one on its right hand without returning to scheduler, to save cpu resources.

-the main Scheduler mySCoop.yield() has the same behaviour than SCoopTask::yield() and now runs a complete cycle, trying to launch each timer, event or task once, before returning in the main loop(). Therefore mySCoop.cycle() is useless and should not be used any more.

-these 2 changes can be set off by changing the value of a predefined variable called SCoopYIELDCYCLE at the begining of the SCoop.h file to "0". Then yield() is always returning to the main loop() after one switch.

-the value for SCoopDefaultStackSize for AVR has been modified and reduced to 150 bytes. this can be changed to any higher or lower value of course. This save memory for basic programs.

-new macro introduced to make easier and quicker definition of event, timers and task , by directly including the myevent::run() or myTimer::run() or myTask::loop() in the macro name. declaring a task is now as simple as defineTaskLoop(myTask) { .. loop code ... }. Same for defineEventRun(myEvent) {...} or defineTimerRun(myTimer) { ... }

-change in the defineTimer and defineEvent macro which now requires the definition of BOTH setup() and run() code so that the user program can create a myevent::setup() {...} ormyTimer::setup() { ...} in addtion to the usual myevent::run() {...} or myTimer::run() { ... } // NON BACKWARD COMPATIBLE please update your program //

-New object class SCoopDelay and SCoopDelayus for easy and quick creation of timers counting down. see user guide for all the attached method and operator overload feature. This object is also used internally by the library methods.

-sleepSync can now be used with a timeout parameter like if (sleepSync(var, 1000)) { ... } will return true if the var is set to true within the timeOut otherwise return false after time spent. see user guide.

-new model and definitons for the tasks/timer/event "state". Paused is introduced
-introduce pause() method. this set the state to SCoopPAUSED and the object will not be launched by the scheduler, until resuming.
-introduce resume() method for clearing the pause flag and enabling further launch by the scheduler.
-introduce paused() to retreive the paused status of the object

-new macro SCoopATOMIC { ... } (and yieldATOMIC) has been introduced, to create an atomic bock section of code where the yield() is disabled. mySCoop.Atomic++ is inserted at the begining of the code and mySCoop.Atomic-- is inserted at the end. (thanks to Dean Camera for the famous trick with the for (x,y,z) and __cleanup__ attribute.

-new macro SCoopPROTECT() (and yieldPROTECT) has been introduced to provide a safe way to avoid re-entrance in libraries or function when the standard yield() is introduced in a library function that might be called by many task at a same time... this macro will generate a static flag and will check this flag at the begining of the function where the macro is used. if the flag is true then the macro wait by calling yield, otherwise the flag is set and thefunction proceed with its potential yield() call. flag is reseted at the end of the function bloc code. SCoopUNPROTECT() also introduced to reset the flag asap.

-by default the variable defined at the beginign of the SCoop.h file named SCoopTIMEREPORT is now set to 0. Therefore no measurement is made for cycle time and task time. The coresponding variable are also not declared in memory. This brings a faster yield() and less memory footprint. it is still possible to set this variable between 1 and 4 for AVR or 1 and 7 for ARM, to provide average cycle and task time calculation. this is usefull for optimizing multitasking and time spread across tasks.

-typically for AVR, the default size for the timer and counters used in SCoopDelay , SCoopTimer and in sleep() is declared at the begining of the SCoop.h file (SCDelay_t and and can be changed to 16bits if needed, to save memory and CPU time.

-SCoopDefaultQuantum can be define to 0 by default at the begining of the SCoop.H file if needed. then the yield() will always switch to next task or timer, whatever is the time effectively spent in the task. similar to Android Arduino DUE Scheduler.

-new mySCoop.start(xx) function, which corespond to mySCoop.start() but calculating first the global quantum time for each task, considering the number of tasks initialized. xx could be set to 0 to force yield() to systematically switch. by extension mySCoop.start(xx,yy) can also be used to setup a specif amount of time yy in the main Loop().

-some global variables moved in the mySCoop object and renamed accordingly. SCoopAtomic becomes mySCoop.Atomic; SCoopTaskPtr becomes mySCoop.Task; SCoopCurrent becomes mySCoop.Current; SCoopNumberTask becomes mySCoop.NumberTasks. SCoopFirstItem remains.

-possibility to rename "mySCoop" with whatever you like, like "Sch" or "Scheduler" by changing a variable in the header file :)

-new method SCoopFifo::flushNonAtomic() which do the same as flush() but without touching interupts...

-some bugs corrections in the code and in the macros, but difficult to remember.

-All files now combined in a single SCoop.h (550 lines) and SCoop.cpp (850)... this simplifies also code distribution as the user can no include these 2 files in his/her own sketch folder without relying on a libray that might be of another version. there are pros and cons of course :)

-a new embded SCoopMicros16() function has been created for the AVR platform in order to bring much faster performance (especially on Arduino UNO) as this method was called often by the yield() to check time spent in the task. This effort was possible by reusing piece of asm code writen for teensy core. see copyright information inside source code. Thanks to paul@pjrc for his clever devlopment.

-new code for first initialization of a task, by copying whole stack context. this brings imediate compatibility with atmega2560 (3 bytes PC) - not tested :) -

-internal function of the libray forcing or avoid inlining to optimize code or speed depending on context. code optimized during setup and speed optimized during object launch or switching;

-code optimized if SCoopTIMERPORT == 0 or task quantumMicros == 0 in order to limit or avoid where possible useless calls to micros() or time spent for calculation.

-code rewritten in sleep and sleepUntil to benefit from the generic SCoopDelay timer.

-introduce new static method mySCoop.sleep(x) as a replacement for any delay(x) in the user code. especially important for arduino <150 where yield() is not systematically included in the standard delay()

-SCoopFifo code cleaned up with smart use of new macro AVR_ATOMIC { }
-introdcution of a new macro ASM_ATOMIC { } providing either ARM or AVR atomic code

- name of example 2 switched with example 1 :) example 1 now provides a very easy/basic example for using a timer and 2 tasks.
- example 2 (old example 1) still very useless, but brings most of the SCoop functions all together in a single file, as a tuto.
- example 3, memory footprint.
- example 4 : not really changed : on AVR only use ISR to push values in fifo.
- example 5 : not really changed : example of sampling and treatment in separate tasks
- performance 1 : modified in order to self calculate the time taken by a yield() in the 2 scenarios (time spent below or over time quantum).

-user guide modified to reflect new program behaviour, and perfomances measured. now 20 pages

-Arduino Scheduler library ported on AVR and included in the SCoop pack. see end of user guide.

-new method startLoop and killMe in the SCoop libray, to create dynamic task using malloc, free, new and delete. COMPATIBLE with Arduino Scheduler. so you can choos SCoop instead :)

huhhh

V1.1.1 modify SCoopFifo to make code atomic on AVR, so that it can be used in ISR/Interupts

V1.1 brings SCoopFifo and corect basic bugs. 17 pages user guide

V1 first verions introducing SCoopTask, SCoopTimer, SCoopEvent. Includes extra libraries for Input, Outputs, InputFiltered, TimerUp & Timer Down. 14 pages user guide.

>>>>>>> upstream/master
V0.9 beta version
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ public AnalogInputPara(Long blockId, Translator translator, String codePrefix, S
@Override
public String toCode() throws SocketNullException, SubroutineNotDeclaredException
{
<<<<<<< HEAD
String ret;
=======
String ret, pin;
>>>>>>> upstream/master
TranslatorBlock childBlock;

ret = "{";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ public DigitalInputPara(Long blockId, Translator translator, String codePrefix,
@Override
public String toCode() throws SocketNullException, SubroutineNotDeclaredException
{
<<<<<<< HEAD
String ret;
=======
String ret, pin;
>>>>>>> upstream/master
TranslatorBlock childBlock;

ret = "{";
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/ardublock/ui/OpenblocksFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
import java.awt.Desktop;
import java.awt.Dimension;
import java.awt.FlowLayout;
<<<<<<< HEAD
=======
import java.awt.Graphics;
>>>>>>> upstream/master
import java.awt.Graphics2D;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
Expand Down
6 changes: 5 additions & 1 deletion src/main/resources/com/ardublock/block/ardublock.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1121,4 +1121,8 @@ bg.little_bits_uvled.description=This is UVLED
bg.little_bits_vibration_motor=Vibration_Motor
bg.little_bits_vibration_motor.description=This is Vibration_Motor
bg.little_bits_synthspeaker=synthspeaker
bg.little_bits_synthspeaker.description=This is synthspeaker
<<<<<<< HEAD
bg.little_bits_synthspeaker.description=This is synthspeaker
=======
bg.little_bits_synthspeaker.description=This is synthspeaker
>>>>>>> upstream/master
13 changes: 13 additions & 0 deletions src/main/resources/com/ardublock/block/ardublock_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ bc.watchdog_enable=permettre
bc.eeprom_address=Adresse
bc.eeprom_data=Donn\u00e9es
bc.ln=nouvelle ligne
<<<<<<< HEAD
bc.print=message
=======

>>>>>>> upstream/master

bg.variable_poly=Nom de la variable char
bg.setter_variable_char=Mettre la variable char \u00e0
Expand Down Expand Up @@ -247,6 +251,7 @@ bg.tan=tan
bg.true=VRAI
bg.ultrasonic=Capteur Ultrason
<<<<<<< HEAD
<<<<<<< HEAD
bg.keyboard=Clavier
bg.keyboard_post=Envoie du clavier
bg.DuinoEDU_Mouse_Init=Init Souris
Expand All @@ -257,6 +262,8 @@ bg.DuinoEDU_Mouse_Ymove=Souris Y d\u00e9placement
bg.DuinoEDU_Mouse_Ymove.description= Souris Y d\u00e9placement
=======
>>>>>>> upstream/master
=======
>>>>>>> upstream/master
bg.variable_digital=nom de la variable num\u00e9rique
bg.while=Tant que...
bg.wire_read=lire depuis le I2C
Expand Down Expand Up @@ -335,13 +342,16 @@ bg.not.description=Le contraire de
bg.equal_poly.description=Vrai si le premier caract\u00e8re est \u00e9gale au deuxi\u00e8me caract\u00e8re
bg.not_equal_poly.description=Vrai si le premier caract\u00e8re n'est pas \u00e9gale au deuxi\u00e8me caract\u00e8re
<<<<<<< HEAD
<<<<<<< HEAD
bg.equal_string.description==Vrai si le premier message est \u00e9gale au deuxi\u00e8me message
bg.not_equal_string.description==Vrai si le premier message n'est pas \u00e9gale au deuxi\u00e8me message
bg.string_equal.description= Vrai si le premier message est au deuxi\u00e8me message
bg.string_toInt.description=Vrai si la chaîne numérique comparé est \u00e9gale au nombre qu'elle représente
bg.millis.description=Temps en millisecondes
=======
>>>>>>> upstream/master
=======
>>>>>>> upstream/master
bg.true.description=Valeur bool\u00e9enne vraie.
bg.false.description=Valeur bool\u00e9enne fausse.
bg.setter_variable_digital.description=d\u00e9finir une variable num\u00e9rique
Expand Down Expand Up @@ -484,6 +494,7 @@ bg.seeed_push_button.description=Bouton
bg.seeed_ir_dist_int.description=This IR Distance Interrupter features a high-sensitivity RFR-359F photoreflector to perform distance detection function.


<<<<<<< HEAD
<<<<<<< HEAD
bd.DuinoEDU=DuinoEDU Grove Add
bg.DuinoEDU_infrared=Infrarouge
Expand Down Expand Up @@ -573,6 +584,8 @@ bg.DuinoEDU_setSerialInfosOff=desactiver
bc.DuinoEDU_serial_display=affichage port série
=======
>>>>>>> upstream/master
=======
>>>>>>> upstream/master

bg.ls_10mmLEDModule.description=Module DEL 10mm bleu/vert/jaune/rouge
bg.ls_5mmLEDModule.description=Module DEL 5mm bleu/vert/jaune/rouge
Expand Down

0 comments on commit ad9892e

Please sign in to comment.