Submission for screening task 6
By :-
Deepam Priyadarshi
[email protected]
[email protected] (personal)
Since the initial django docker image present at docker.pkg.github.com/frg-fossee/esim-cloud/django:dev
has only avr-gcc
toolchain support, so I can only implement C inline Assembly
programming in which the avr-gcc
compiles .c
files. For using .asm
file we require avra
assembler, for which I have to rebuild the comtainer images.
For the swithcing between the programming languages, the users have the liberty to select the type of programming language from the editor' drop down menu as shown in the figure:-
- To compile the
.c
file received from the frontend we use the commandavr-gcc -Os -DF_CPU=16000000UL -mmcu=atmega328p -c -o {obj_name} {ino_name}
- The above step generates an object file
sketch.o
which is then converted to a binary file namedsketch
using the commandavr-gcc -mmcu=atmega328p {obj_name} -o {bin_name}
- The binary file is then converted to IntelHEX format using the command
avr-objcopy -O ihex -R .eeprom {bin_name} {out_name}
- A new form element was added in the
code-editor.component.html
file which takes the input of the desired programming laguage in the form of a drop down menu. - A new property
progLang
was introduced in thewindow
object which keeps the track of programming language used. - A new function
CompileInlineASM
is introduced in thetask.py
file which compiles the C Inline assembly code usingavr-gcc
. - A new class
CompileSketchInlineASM
in introduced in theviews.py
file - New routes and urls are added in the
urls.py
andapi.service.ts
files. And the respective apis are called in theworkspace.ts
file according to the requirement.
eSim-Cloud/esim-cloud-backend/arduinoAPI/tasks.py
eSim-Cloud/esim-cloud-backend/arduinoAPI/views.py
eSim-Cloud/esim-cloud-backend/arduinoAPI/urls.py
eSim-Cloud/ArduinoFrontend/src/app/Libs/Workspace.ts
eSim-Cloud/ArduinoFrontend/src/app/Libs/Workspace.ts
eSim-Cloud/ArduinoFrontend/src/app/code-editor/code-editor.component.ts
eSim-Cloud/ArduinoFrontend/src/app/code-editor/code-editor.component.html