pts/test/example: added PtsError exception as example

parent 3edff46b
......@@ -7,7 +7,7 @@
# Website: http://www.ohwr.org
import sys
import rr # Needed for accessing the rawrabbit driver
#import rr # Needed for accessing the rawrabbit driver
import time
import os
from ptsexcept import * # Declaration of Exceptions
......@@ -45,7 +45,10 @@ def main (default_directory='.'):
"""
# After loading the firmware, we are ready to access to the registers.
gennum = rr.Gennum();
# gennum = rr.Gennum();
# Invented variable.
gennum = 0;
# Instantiate CTest.
# The parameters are the Gennum variable and the Wishbone base address
......@@ -57,6 +60,8 @@ def main (default_directory='.'):
# values, etc.
hi.hello("world")
raise PtsError('This message shows an error in the application');
# This code calls the 'main' function when the program is executed by command-line
# using './test00.py' or 'python test00.py'. In case of importing this Python program
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment